Inventor General Discussion

Inventor General Discussion

Reply
Valued Contributor
dclunie
Posts: 70
Registered: ‎03-26-2008
Message 1 of 4 (295 Views)
Accepted Solution

Ilogic code to access "ModelingSettings.SolidBodyNamePrefix() As String"

295 Views, 3 Replies
10-09-2012 08:22 AM

Hi

 

I am after help we are attempting to access the file naming  prefix in documents settings but i am unable to start code or find away to get where i need.

 

We have a multi solid bodie part that changes on via suppression to different styles of profile we then need the file naming prefix to chage depending on what key have selected .

 

ie Parameter = Style with 4 Multi selctions 1,2,3,4

depending on selection picked we then need to change the Solid Bodies Prefix in document settings..

 

Example :: If style = 1 then Solid Bodies Prefix = Dave

 

Any Help would be appreciated

 

D Clunie

 

 

 

 

 

 

 

Hi dclunie,

 

Here's a quick snippet that will set the prefix from a list.

I've attached this as a *.txt file as well , in case the line wrap causes an issue.

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

 

Dim MyArrayList As New ArrayList
MyArrayList.add("Sandcladding")
MyArrayList.add("Cellufoam")
MyArrayList.add("Timberclad")
'get input from user
sPrefix = InputListBox("Select an option: ", MyArrayList, MyArrayList.Item(0), "iLogic", "List of Options")
'Define the open document
Dim openDoc As Document
openDoc = ThisDoc.Document
'set solid body prefix
openDoc.ModelingSettings.SolidBodyNamePrefix = sPrefix

 

*Expert Elite*
Curtis_Waguespack
Posts: 2,986
Registered: ‎03-08-2006
Message 2 of 4 (286 Views)

Re: Ilogic code to access "ModelingSettings.SolidBodyNamePrefix() As String

10-09-2012 09:04 AM in reply to: dclunie

Hi dclunie,

 

Here's an example of renaming solid bodies using a prefix, although it uses a slightly different method:

http://inventortrenches.blogspot.com/2012/02/ilogic-to-rename-all-solid-bodies.html

 

It's not exaactly what you were after, but might help you get there.

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com



  solution.png  Did you find this reply helpful ? If so please use the Accept as Solution or  Kudos button below.





Valued Contributor
dclunie
Posts: 70
Registered: ‎03-26-2008
Message 3 of 4 (273 Views)

Re: Ilogic code to access "ModelingSettings.SolidBodyNamePrefix() As String

10-09-2012 12:15 PM in reply to: dclunie

Hi Curtis

 

We have this code from your website but can this be manipulated to do what i need

as we want the prefix to be set before we start to make solids

 

Select key 1 that Equals sandcladding then prefix is set to Sandcladding

Select key 2 that Equals Cellufoam then prefix is set to Cellufoam

Select key 3 that Equals Timberclad then prefix is set to Timberclad

 

the idea being that we can have solid bodies named as we create and using view rep rule to isolate by name.

 

Hope this makes sense

 

d clunie

 

 

*Expert Elite*
Curtis_Waguespack
Posts: 2,986
Registered: ‎03-08-2006
Message 4 of 4 (268 Views)

Re: Ilogic code to access "ModelingSettings.SolidBodyNamePrefix() As String

10-09-2012 12:37 PM in reply to: dclunie

Hi dclunie,

 

Here's a quick snippet that will set the prefix from a list.

I've attached this as a *.txt file as well , in case the line wrap causes an issue.

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

 

Dim MyArrayList As New ArrayList
MyArrayList.add("Sandcladding")
MyArrayList.add("Cellufoam")
MyArrayList.add("Timberclad")

'get input from user
sPrefix = InputListBox("Select an option: ", MyArrayList, MyArrayList.Item(0), "iLogic", "List of Options")

'Define the open document
Dim openDoc As Document
openDoc = ThisDoc.Document
'set solid body prefix
openDoc.ModelingSettings.SolidBodyNamePrefix = sPrefix

 



  solution.png  Did you find this reply helpful ? If so please use the Accept as Solution or  Kudos button below.





Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!