Author Topic: Change ID of an entity  (Read 378 times)

Offline Imaneejj

  • Ewok
  • *
  • Posts: 2
    • View Profile
Change ID of an entity
« on: January 05, 2021, 11:06:56 am »
Hi everyone !

I’m actually discovering Cambam and I can’t find how to change ID of entities ( polylines(420) to polyline(422) for example) they are automatically (and sometimes randomly) named.
I need to change their ID since I’m working on a script that will give a machining operation MOP to each entity, for example Pocket to polyline that has the ID primitive 15 (polyline(15)) 

Thanks,
Imane

Online dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 6383
    • View Profile
    • Cambam V1.0 French Doc
Re: Change ID of an entity
« Reply #1 on: January 05, 2021, 23:48:39 pm »
Hello

The ID of an entity can't be changed ;)

++
David

Offline lloydsp

  • CNC Jedi
  • *****
  • Posts: 8409
    • View Profile
Re: Change ID of an entity
« Reply #2 on: January 06, 2021, 00:32:10 am »
Instead, write your script so you can supply the entity's I.D. at the time of running.

Lloyd
"Pyro for Fun and Profit for More Than Fifty Years"

Offline EddyCurrent

  • CNC Jedi
  • *****
  • Posts: 4645
    • View Profile
Re: Change ID of an entity
« Reply #3 on: January 06, 2021, 12:15:52 pm »
Maybe you could use an Array and put the appropriate polyline into index position 15 etc.
You could also use layers because these can be renamed as you wish.
« Last Edit: January 06, 2021, 12:18:09 pm by EddyCurrent »
Made in England

Offline Imaneejj

  • Ewok
  • *
  • Posts: 2
    • View Profile
Re: Change ID of an entity
« Reply #4 on: January 06, 2021, 15:59:19 pm »
Thank you guys ,
Yes i tried using Layers in my python script and it's so much simpler . Here's a part of my script :

CamBamUI.MainUI.ActiveView.SelectAllVisibleGeometry()

profile=MOPProfile(newdoc,newdoc.Layers[3].Entities.ToArray())

profile.Style="cutout"


profile.ToolDiameter = CBValue[float](0.0012)
profile.InsideOutside = CBValue[InsideOutsideOptions](InsideOutsideOptions.Inside)
profile.TargetDepth = CBValue[float](-0.01)