Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - ThisAmplifierIsLoud

Pages: 1 [2] 3 4 ... 16
16
Scripts and Plugin Help / Re: c# - Plugin Questions
« on: February 04, 2022, 09:20:17 am »
Were are running in a circle. :-)
Code: [Select]
                        case "LIAaaaaa":
                            // always false, so nothing happens
                            if (profile.LeadInMove.IsCacheSet)
                            {
                                profile.LeadInMove.Cached.SpiralAngle = double.Parse(ParameterValue);
                            }
                            break;


                        case "LIAxxxxxx":
                            // this crashes at runtime : Cannot perform runtime binding on a null reference
                            profile.LeadInMove.Cached.SpiralAngle = double.Parse(ParameterValue);
                            break;


                        case "LIA":
                            // this crashes at runtime : CamBam.Values.CBValue<CamBam.CAM.LeadMoveInfo> does not contain a definitionfor SpiralAngle
                            profile.LeadInMove.SpiralAngle = double.Parse(ParameterValue);
                            break;


So ... can I do anything to force this "Caching" ? Or wait for ?

Best regards

Bernhard

17
Welcome to the club !

Believe, I know ...  you can send a lot of time for that. ;D
maybe you can re-use something from here :

The code I posted is not actual, but it should show how create mops using c#

https://cambamcnc.com/forum/index.php?topic=9560.30

Best regards

Bernhard

18
Scripts and Plugin Help / Re: c# - Plugin Questions
« on: February 03, 2022, 20:44:05 pm »
Eddy,

these values come from the style and library I defined in standard.template (or so).
Or the style was selected before the mop was created.
The task is to keep exactly these ones.

How did you force the values into the mop ?

19
Scripts and Plugin Help / Re: c# - Plugin Questions
« on: February 03, 2022, 16:02:32 pm »
No, Sir !  :'(

See the difference :

The Mop without setting LIA11.1 :
All LeadIn Settings keep set in the used tool



The Mop with setting LIA11.1
here you see : Values are all set to zero, except the SpiralAngle we have set explicitely.


The problem is how to get the LeadMoveInfo from the mop in order to keep all other values unchanged.
Writing to mop is working fine.

Best regards

Bernhard




20
Scripts and Plugin Help / Re: c# - Plugin Questions
« on: February 03, 2022, 13:48:06 pm »
But all values are existing, the LeadMoves and Holding tabs, too !

Remove the LIA11.1 option from the last layer´s name, run the plugin.
You´ll see all values are exisiting.

 Crazy story. ;D

21
Scripts and Plugin Help / Re: c# - Plugin Questions
« on: February 03, 2022, 13:38:40 pm »
                            if (profile.LeadInMove.IsCacheSet)
                            {
                                profile.LeadInMove.SpiralAngle.Cached = double.Parse(ParameterValue);
                            }
                            else
                            {
                                Log("Mööööööööööööööööööööp !!!! not chached");
                            }


And I got : Mööööööööööööööööööööp !!!! not chached"   >:(


Can I force it to Cache ?
This is really complicated.

22
Scripts and Plugin Help / Re: c# - Plugin Questions
« on: February 03, 2022, 13:24:05 pm »
in principle - yes,
but the "else" is IMHO not existing.

On creating a mop new CamBam.CAM.MOPProfile(newdoc, newdoc.Layers[LayerIndex].Entities.ToArray());

all possible values are valid and preset.

(Of course, a drill mop will not own a holding tab.)

23
Scripts and Plugin Help / Re: c# - Plugin Questions
« on: February 03, 2022, 12:41:19 pm »
Yes, the mop already exists and is (pre-)set, at least inherited from actual selected Cam-Style

The result shoud be the same as clicking around :
1. select the entities
2. click Profile, Pocket, Engrave ... then all data is preset.
3. change values you want to change.

The plugin shall
1. select all entites of a layer
2. create a new mop depending on layername´s content
3. change some values depending on layername´s content
4. Add the the Mop to the active part


Quote
What happens if the value has not been set ?
This should be impossible. Values are inherited from the selected CAM Style, at least the unnamed in "standard-mm"



24
Scripts and Plugin Help / Re: c# - Plugin Questions
« on: February 03, 2022, 10:25:33 am »
That´s what I want to do, but it crashed


Code: [Select]
                        // crashing at runtime
                        case "LIA":
                            profile.LeadInMove.SpiralAngle = double.Parse(ParameterValue);
                            break;

And that happens :


25
Scripts and Plugin Help / Re: c# - Plugin Questions
« on: February 03, 2022, 08:22:08 am »
@Armando : This will work only with the old script, not with this plugin.

@Eddy, yes of course, it seems working correct,
but it´s not what I want to.

I want to set the lead in angle only, keeping all other properties unchanged.
Actually I have to set the Type to Spiral explicitely to keep it working.

This is .... hmmmm..  ok for the LeadIn/Out angles, but looking forward to holdings tabs
this makes no sense.

Maybe it´s a problem, that the mop exists, but is still unadded to the system ?

I´ll prepare a crashing code.

Best regards

Bernhard

26
Scripts and Plugin Help / Re: c# - Plugin Questions
« on: February 02, 2022, 16:17:50 pm »
Yes, Sir, why not... there are no secrets inside.  ;D

Hope you can read it.
The critical part you´ll find in AutoMagic in class1 nearby at the end.

a DXF-File as Playground is also included,

Thanks in advance

Bernhard

27
Scripts and Plugin Help / Re: c# - Plugin Questions
« on: February 02, 2022, 14:31:12 pm »
Hi Eddy,

isn´t there is a simple way to write directly to the mop f.e.
 profile.DepthIncrement = new CamBam.Values.CBValue<double>(double.Parse("2.2"));

This mechanism works fine for a lot of stuff !

Obviously the problem is, that LeadIn/Out and tabs are using a complicated mechanism to access the properties.
Seems that at first a "structure" has be copied out, then modified and then write back again. Somehow...

The snippets are running, but they all are writing new data, not modify the properties of an already exisiting mop

Problem is that this is not resolved at runtime, keep in mind that "profile" is defined as
public object profile, the concrete type is set at runtime. (Profile, Pocket, Engrave, Drill)
Until this point this was VERY "elegant".

Whatever I try, it crashed at runtime. See screenshot above.
It´s always the same bermuda triangle.

Do you have another idea ?

Best regards

Bernhard

28
Scripts and Plugin Help / Re: c# - Plugin Questions
« on: February 01, 2022, 12:40:24 pm »
Nearby ... nearby, Eddy.

I would prefer reading out the MOP´s existing LeadInfo, change only a specific property,
then write back to the MOP. (similar to your first proposal).

There´s something strange with the "Cached" or misusing it ?

This will solve my next upcoming problem with holding tabs, too.

29
Scripts and Plugin Help / Re: c# - Plugin Questions
« on: February 01, 2022, 10:48:43 am »
And again you make me smile !

Thanks, Eddy !


PS.: The finish is near !

30
Scripts and Plugin Help / Re: c# - Plugin Questions
« on: February 01, 2022, 08:59:19 am »
I tried, but it crashes at runtime applying to a MOPRrofile.
See what happens.

 :'(



Pages: 1 [2] 3 4 ... 16