Moldflow Insight Forum
Welcome to Autodesk’s Moldflow Insight Forums. Share your knowledge, ask questions, and explore popular Moldflow Insight topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Set Default Display Properties with Macro?

4 REPLIES 4
Reply
Message 1 of 5
Mdemint
530 Views, 4 Replies

Set Default Display Properties with Macro?

I've tried recording a macro while changing default display settings, but it doesn't record.  Is it possible to change these settings with a macro?  If so, what is the syntax?

 

I'm using Moldflow Insight 2011 SP2.

4 REPLIES 4
Message 2 of 5
nordhb
in reply to: Mdemint

Hi,

when changing M>Options tab Default Display, the display will be set for all geometries no matter on which layer it is.

 

To change the display, it is controlled by LayerManager and LayerManager.SetTypeDisplayOption.
as same kind of entity can be displayed different, depending on which layer it belongs to.

If you record a macro changing display by :

on a layer with wished entity: rightclick and select Display...

change display settings and stop recording and view the macro created you will see what code looks like.

 

Via Help- API Reference you can find more:

In the Synergy Ribbon UI, you have the question mark at upper right corner:
Click on the small arrow down just to the right of the question mark:
select "API reference"
and class LayerManager

Hope this helps.

Regards,
Berndt

 



Berndt Nordh
Message 3 of 5
Mdemint
in reply to: Mdemint

Great!  Now is it possible to set up a loop to change the display of all layers or is it possible to change all layers at once?  

 

When I recorded the macro, I changed the display of two layers.  The macro recognized the layers as L33 and L75.  Can we only refer to the layer by it's number?  Or can we select a layer based on layer names?

 

If I wanted to change the display for beams on all layers, say, axis line only... is there a command to change all layers at once, or would I have to use something like:

 

 

Set LayerManager = Synergy.LayerManager()
Set EntList = LayerManager.CreateEntityList()
EntList.SelectFromString "L1 "
LayerManager.SetTypeDisplayOption, "B", "Axis Line Only"
EntList.SelectFromString "L2 "
LayerManager.SetTypeDisplayOption, "B", "Axis Line Only"
EntList.SelectFromString "L3 "
LayerManager.SetTypeDisplayOption, "B", "Axis Line Only"
...
Thanks again for the help!

 

Message 4 of 5
nordhb
in reply to: Mdemint

Hi,
there is a way to loop through layers and set display as:

 

Set LayerManager = Synergy.LayerManager()
Set LayerID = LayerManager.GetFirst()
While Not LayerID Is Nothing
  LayerManager.SetTypeDisplayOption LayerID, "B", "Axis Line Only"
  Set LayerID = LayerManager.GetNext(LayerID)
Wend

 

This should display beams as you wish on all layers.

 

Regards,
Berndt



Berndt Nordh
Message 5 of 5
Mdemint
in reply to: nordhb

Great... that's what I was looking for...

 

Thanks!

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report