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 5 ... 16
31
Scripts and Plugin Help / Re: c# - Plugin Questions
« on: January 31, 2022, 17:09:34 pm »
Oh, this runs very fine in any case !

But I have problems to figure out how to handover data to the leading in/out structures.

32
Scripts and Plugin Help / Re: c# - Plugin Questions
« on: January 31, 2022, 12:55:20 pm »
Hossa !
And here´s the next question :
I can´t figure out how to set the LeadIn/Out SpiralAngles using c#.

using pythons it works like this
Code: [Select]
                    LeadInfo = profile.LeadInMove.Cached
                    LeadInfo.SpiralAngle = (float) (Parameter)   
                    profile.LeadInMove = CBValue[LeadMoveInfo] (LeadInfo)

Best regards

Bernhard

33
Scripts and Plugin Help / Re: c# - Plugin Questions
« on: January 28, 2022, 14:34:14 pm »
(Yes Eddy, you´re so right.)


Ha !

And I figured out by myself (YES!)  ;D

 instead of
  MOPFromGeometry profile;

I use
 dynamic profile;

so I can access properties at runtime, which are not defined in MOPFromGeometry at compiling!

Cheers !


34
Scripts and Plugin Help / Re: c# - Plugin Questions
« on: January 28, 2022, 08:13:05 am »
Now it´s coffetime here in good ole Germany
and Eddie´s solution works like a charm.

Thanks again !

35
Scripts and Plugin Help / Re: c# - Plugin Questions
« on: January 27, 2022, 21:33:25 pm »
Yehaaaaa, thanks !

I'll try tomorrow, actually it's beer drinking time here in good ole Germany !

Once upon a time (approx.25 years) I was a software developing engineer,
but in between there is so much I have forgotten and  there is so much new stuff to learn.

Cheers !

36
Scripts and Plugin Help / Re: c# - Plugin Questions
« on: January 27, 2022, 13:28:33 pm »
And the next question refers to c# itself...

I hope you "feel" what I want to do, I am a C# rookie.

C# is moaning, of course, because I want to assign new objects of similar, but different types.
(Python was very "tolerant" about that)

I hope MOPProfile, MOPPocket.... are derived from MachineOp ?

Code: [Select]
                    MachineOp profile;

                        switch (command)
                        {
                            case "I":
                                profile = new MOPProfile(newdoc, newdoc.Layers[LayerIndex].Entities.ToArray());
                                profile.InsideOutside = new CamBam.Values.CBValue<InsideOutsideOptions>(InsideOutsideOptions.Inside);
                                break;
                            case "O":
                                profile = new MOPProfile(newdoc, newdoc.Layers[LayerIndex].Entities.ToArray());
                                profile.InsideOutside = new CamBam.Values.CBValue<InsideOutsideOptions>(InsideOutsideOptions.OutSide);
                                break;
                            case "P":
                                profile = new CamBam.CAM.MOPPocket(newdoc, newdoc.Layers[LayerIndex].Entities.ToArray());
                                break;

                        }

37
Scripts and Plugin Help / Re: c# - Plugin Questions
« on: January 27, 2022, 09:21:11 am »
THX, only aliens are able to figure that out.  ;D

38
Scripts and Plugin Help / Re: c# - Plugin Questions
« on: January 26, 2022, 15:04:36 pm »
And here´s the new question of the day !


How to set inside/outside of a MOPProfile ?

Code: [Select]
                        CamBam.CAM.MOPProfile profile;
                        profile = new CamBam.CAM.MOPProfile(newdoc, newdoc.Layers[LayerIndex].Entities.ToArray());
                        profile.Enabled = false;  // just an example to see it working
                        profile.Name = "Captain Bacardi";

                        profile.InsideOutside = ????

                        CamBamUI.MainUI.InsertMOP(profile);


Best regards

Bernhard



EDIT : using python it worked fine :
Code: [Select]
                profile=MOPProfile(newdoc,newdoc.Layers[i].Entities.ToArray())
                profile.InsideOutside = CBValue[InsideOutsideOptions](InsideOutsideOptions.Inside)

39
Scripts and Plugin Help / Re: c# - Plugin Questions
« on: January 25, 2022, 11:49:15 am »
And again you made my day, thank you !

I think this will solve some similar "effects", I´ve seen.

40
Scripts and Plugin Help / Re: c# - Plugin Questions
« on: January 25, 2022, 11:12:15 am »
No, Sir,  :(

(missing your post ?)

I still get the wrong ID based upon the layer´s entity list before joining.

After joining manually the result is correct.

41
Scripts and Plugin Help / Re: c# - Plugin Questions
« on: January 25, 2022, 09:28:29 am »
And the next problem is around the corner - please help !

Code: [Select]
                       
                        // collect points to a pointlist for nesting ------------------------------------
                        // select complete layer
                        view.SelectAllLayerGeometry(newdoc.Layers[LayerIndex]);

                        // Edit - Join Points/Pointlists to a single Pointlist
                        PointListUtils.JoinPointlist(CamBamUI.MainUI.ActiveView);

                        // until here everything works correct, multiple pointlists are joined to a single new one, I see it in the tree

                        NestingPointlistID = newdoc.Layers[LayerIndex].Entities[0].ID; // <=== returns the no longer existingID before joining instead of new one !



Again a kind of refresh / update problem.
And -how funny- I have done this in a python script working fine !

I tried without success :
Code: [Select]
                        CamBamUI.MainUI.ActiveView.DrawingTree.Update();
                        CamBamUI.MainUI.ActiveView.DrawingTree.Refresh();
                        CamBamUI.MainUI.ActiveView.DrawingTree.ReloadTree();
                        CamBamUI.MainUI.CADFileTree.Refresh();

42
Scripts and Plugin Help / Re: c# - Plugin Questions
« on: January 22, 2022, 14:42:46 pm »
"Made in England" ... these old eyes ... and the dark sunglasses ...  ::)

43
Scripts and Plugin Help / Re: c# - Plugin Questions
« on: January 22, 2022, 14:31:55 pm »
Eddy .... Thank you !

And again I owe you a can of beer.

If we ever meet, I´ll be a poor man !  ;D


What time is it actually at your site ?

44
Scripts and Plugin Help / Re: c# - Plugin Questions
« on: January 22, 2022, 14:05:14 pm »
Eddy, my personal hotline ...  ;D

THX for fast reply. But none of them was working.

BTW. using Visual Studio 2022 you can also inspect the references !

45
Scripts and Plugin Help / Re: c# - Plugin Questions
« on: January 22, 2022, 11:31:43 am »
I tried that :

https://www.cambam.co.uk/forum/index.php?topic=7795.msg62454

but it seems not  working :

The deleted layer is still visible, the entities within disappeared, but are still present.
Somewhat strange.

I looks like a kind of update is missing.

But if I try the method Update, CB wants to save a CB file.


EDIT : After saving and reloading the CB-File the deleted layers are gone,
so just a kind of "refresh", "garbage collection" ... is missing ?


EDIT :
doing this in python script works fine , the layer view is updated immediately:

newdoc.SetActiveLayer(newdoc.Layers[0].Name)
newdoc.ActiveLayer.Entities.Clear()
newdoc.Layers.Remove(newdoc.ActiveLayer)

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