Simulation Forums

Find Simulation answers, share expertise, and connect with your peers

Simulation Moldflow Insight


Move entities from one layer to another layer via script

62 Views, 3 Replies
01/24/2018 2:36 PM

I'm trying to create a macro that will take all entities from a specific layer (Named "Beams") and move them to another specific layer (Named "Nozzle")

 

I can't seem to find a way to select the entities that I want to move. I know once I have them selected, I can assign then to the layer I want, but it's the selection part that I am struggling with.

 

Can anybody help with this?

 

Thanks


Report Inappropriate Content
Message 1 of 3 ( Views: 62 )

Re: Move entities from one layer to another layer via script

01/24/2018 3:29 PM

Hi,

currently you need to select entity/entities (using for example Predicate) , and the look up the layer it is assigned to, and if matching search name add to a selection list. This is time consuming.

For example using Predicate to select Triangles, then get the triangle layer by using GetEntityLayer.


I created an example in this post:
How to realize "select by layer and select all " by VB Scripts

Have a look if it can be adopted for your needs.

 

Futher, I have asked for improvement:
API : select by layer in macros

 

Kudos it if you agree. Smiley Happy

 

Hope this helps.

Regards,

Berndt

( If my comments are accepted, provide "Kudos" as appreciation. If your request is answered/resolved, please click the "Accept as Solution" button. Thanks.)

Report Inappropriate Content
Message 2 of 3 ( Views: 55 )

Re: Move entities from one layer to another layer via script

01/24/2018 3:46 PM

Thanks, not very elegant, but looks like I can make it work, Was hoping for something simpler/faster.

 

I voted for you API addition as well. 5 votes won't go very far though...

 

 


Report Inappropriate Content
Message 3 of 3 ( Views: 52 )