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: 

Help: iProperty populate iLogic

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
Anonymous
1093 Views, 3 Replies

Help: iProperty populate iLogic

I am trying to use iLogic to automatically populate an iProperty value based on the dimensions of the flat patterns. I want the formatting to read as Length X Width. Currently I have the following:

If component_type="standard" Then
iProperties.Value("Custom","TOTAL MATERIAL USED")=Round(extents_width, 0)" X "Round(extents_length,0)
Else
iProperties.Value("Custom","TOTAL MATERIAL USED")=Round(extents_width, 0)" X "Round(extents_length,0)
End If

I am getting:

Error on Line 11 : End of statement expected.

Error on Line 13 : End of statement expected.

 

I'm guessing this is due to using the " X " or having multiple parameters in the same line. If anyone knows the right way to structure this I would appreciate any help you can give.

 

Also, if there is a way to make these values multiplied by the quantity of parts in an assembly drawing bom to get total stock used that would be very helpful.

 

EDIT:

Simplified Code:

extents_length = SheetMetal.FlatExtentsLength
extents_width = SheetMetal.FlatExtentsWidth
iProperties.Value("Custom","TOTAL MATERIAL WIDTH")=extents_width
iProperties.Value("Custom","TOTAL MATERIAL LENGTH")=extents_length
iProperties.Value("Custom","TOTAL MATERIAL USED")=extents_width" X " extents_length

Now getting:

Error on Line 5 : End of statement expected.

3 REPLIES 3
Message 2 of 4
jtylerbc
in reply to: Anonymous

I'm not certain of the syntax to do exactly what you're trying to do.  However, I can propose an alternative that may be easier.  I believe you can fix this in the custom iProperty itself.

 

For the value of the TOTAL MATERIAL USED property, type the following iProperty expression:

 

=<TOTAL MATERIAL WIDTH> X <TOTAL MATERIAL LENGTH>

 

Then, remove the TOTAL MATERIAL USED line from your iLogic rule altogether. 

 

 

Message 3 of 4
Yijiang.Cai
in reply to: Anonymous

Generally we need to add the "&" for the string connected. Please see them below -

If component_type="standard" Then
iProperties.Value("Custom","TOTAL MATERIAL USED")=Round(extents_width, 0) & " X " & Round(extents_length,0)
Else
iProperties.Value("Custom","TOTAL MATERIAL USED")=Round(extents_width, 0) & " X " & Round(extents_length,0)
End If
Thanks,
River Cai

Inventor Quality Assurance Team
Autodesk, Inc.
Email: River-Yijiang.Cai@autodesk.com
Message 4 of 4
jtylerbc
in reply to: Yijiang.Cai

That's what I thought and was going to suggest yesterday.  Couldn't get it to work at the time - not sure what I was doing wrong then, because it works fine today.

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

Post to forums  

Technology Administrators


Autodesk Design & Make Report