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

iLogic - Part/Assembly name based on length???

2 REPLIES 2
Reply
Message 1 of 3
Josy05
408 Views, 2 Replies

iLogic - Part/Assembly name based on length???

Hello to all,

 

I've been adding formulas in the parameters to drive the design intent, this works fine and i'm very thankful for all the good advice the community members have given me lately. Still looking for a few answers to create the perfect workflow, until then I have a new question.

 

I guess iLogic rules will be able to help me, but i'm so green on the matter. I need for each part to have distinct names according to the length. Our naming convention calls for a dash and a number. We are not sure if we prefer a numbering scheme with a typical increment of one or if the number should reflect the metric length. This is an internal decision that probably doesn't affect the naming issue I present today.

 

I read a bit on iLogic, done some simple tutorial, seperately the function syntax I can understand, I just don't know how to put everything together in a rule. I've never done any programming, so the language is hard for me to assimilate.

 

Many thanks as usual,

 

 

Josee Laplante
BIM Drafting Technician

AutoCAD 2016
Inventor Professional 2016
Vault Professional 2016
Revit 2014
2 REPLIES 2
Message 2 of 3
mcgyvr
in reply to: Josy05

look at "iproperty expressions"

like this kind of stuff which doesn't require ilogic,etc..

http://modthemachine.typepad.com/my_weblog/2010/04/iproperty-expressions.html

http://cadtoolbox.com/2010/10/21/iproperty-expressions/

 

 

or stuff like this ..http://inventortrenches.blogspot.com/2011/01/ilogic-code-to-set-part-number-per.html



-------------------------------------------------------------------------------------------
Inventor 2023 - Dell Precision 5570

Did you find this reply helpful ? If so please use the Accept Solution button below.
Maybe buy me a beer through Venmo @mcgyvr1269
Message 3 of 3
jletcher
in reply to: Josy05

Yes ilogic can do this but I think to help you with code we will need to know what you want and parameters you have to use in the code.

 

I have lots of parts that use the length my are in inch but here is a snip.

 

This does the part number properties.

iLogicOption DoubleForEquals Off
L_1 = Format(LENGTH, ".000")
'Rod= Format(Shaft_Dia, "0.000")



iProperties.Value("Project", "Part Number")= "900C7J" & L_1

 

This generates the part with file name..

 

Dim fileName As String
Dim path As String
path = ThisDoc.WorkspacePath()
fileName = "filename"

ThisDoc.Document.SaveAs(path & "\" & "900C7J" & L_1 & ".ipt" , False)


			

doc = ThisDoc.Document
path_and_name = ThisDoc.PathAndFileName(False) ' without extension


iLogicVb.UpdateWhenDone = True






MessageBox.Show("Your file has been made")

 

Result

pn.JPG

 

If you give mre info I can help more....

 

 

 

 

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

Post to forums  

Autodesk Design & Make Report