Author Topic: Altium API paste special?  (Read 1442 times)

0 Members and 1 Guest are viewing this topic.

Offline CloudTopic starter

  • Regular Contributor
  • *
  • Posts: 194
  • Country: si
Altium API paste special?
« on: April 15, 2021, 08:15:10 am »
I am trying to make a script, that would select all the objects from one layer and paste them onto different layer. But in API documentation I can't seem to find paste special. There is one example, but it reads element by element and redraws them onto different layer.
 

Offline tszaboo

  • Super Contributor
  • ***
  • Posts: 7357
  • Country: nl
  • Current job: ATEX product design
Re: Altium API paste special?
« Reply #1 on: April 15, 2021, 08:24:31 am »
You select everything, open PCB list panel (view menu), and edit the layer it's on.
Takes a few seconds, unless you do this very often, I dont think making a script is worth it.
 

Offline CloudTopic starter

  • Regular Contributor
  • *
  • Posts: 194
  • Country: si
Re: Altium API paste special?
« Reply #2 on: April 15, 2021, 09:46:26 am »
I have to edit cca 10k components so I would rather have script that does this for me
 

Offline tszaboo

  • Super Contributor
  • ***
  • Posts: 7357
  • Country: nl
  • Current job: ATEX product design
Re: Altium API paste special?
« Reply #3 on: April 15, 2021, 10:33:25 am »
I have to edit cca 10k components so I would rather have script that does this for me
If you select all components at the same time, than it takes the same amount of time to do it than 1 component.
Excluding online DRC and whatnot.
 

Offline CloudTopic starter

  • Regular Contributor
  • *
  • Posts: 194
  • Country: si
Re: Altium API paste special?
« Reply #4 on: April 15, 2021, 11:10:20 am »
I have to edit cca 10k components so I would rather have script that does this for me
If you select all components at the same time, than it takes the same amount of time to do it than 1 component.
Excluding online DRC and whatnot.
Sorry I wrote a big misleading, I have to add this copy of the layer on pcb library with 10k + components
 

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 21651
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: Altium API paste special?
« Reply #5 on: April 15, 2021, 04:27:42 pm »
So you need to specifically duplicate some items?

Then, more than layer change is required.  (Layer and other parameter changes can be done across a library, given a suitable query; the operation cannot be undone, so save the library before doing it.)

I'm not familiar with the scripting engine, but I would suspect a copy-all, paste-all is not available on libraries; you'll have to iterate across all parts and do it.  So, whatever calls are needed to enumerate or increment the current view, and select, duplicate and change objects in that view.

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf