Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Ilogic Not Matching If Text pop for entry

3 REPLIES 3
Reply
Message 1 of 4
beth.maddux
246 Views, 3 Replies

Ilogic Not Matching If Text pop for entry

Hello I am trying to figure out if there is a way to add something to this code to make it work for my other parts as well. Right now I have it fill in a custom iProperty called "Material" if certain sheet metal styles are selected. What I would like I am not sure if you can do or not. I want a statement that is if non of these prompt for entry. So if its not any of these selected materials I want it trigger a free text form. Is that possible? I really don't want different drawing templates for my non sheet metal parts?

Tags (1)
3 REPLIES 3
Message 2 of 4
Ktomberlin
in reply to: beth.maddux

You could add something to your if statement like

 

Else
Dim MyMaterial As String
MyMaterial  = InputBox("Custom Material",  "User Input Material",  MyMaterial)
iProperties.Value("Custom", "Material") = My Material
End If

 

but there are many different ways to do it that might be better in the long run for you.

Message 3 of 4
beth.maddux
in reply to: Ktomberlin

This is the part I have just a couple of the materials in right now eventually I will be adding 250. Any help is appreciated I am hoping to not have to have a separate drawing file for items that are not sheet metal.

Message 4 of 4
Ktomberlin
in reply to: beth.maddux

Not sure exactly what the final result your looking for but try this in your Rule1. 

 


Dim oSheetMetalCompDef As SheetMetalComponentDefinition
oSheetMetalCompDef = ThisDoc.Document.componentdefinition
Dim YourStyle As String
yourStyle = oSheetMetalCompDef.ActiveSheetMetalStyle.Name
Dim oDesc As String
oDesc = iProperties.Value("Custom", "Description")
Dim oType As String
oType = iProperties.Value("Custom", "TYPE")

If yourStyle="10GZ01X03" Then
oDesc = "10 GA GALVANIZED G90"
oType = "GALVANIZED"

ElseIf yourStyle="12HR02B91" Then
oDesc ="HR A1011 TYPE B P/O"
oType = "STEEL HRPO"
 
ElseIf yourStyle="250HR05X03" Then
oDesc = "250 HR A572 50MIN HSLA"
oType= "STEEL 50 MIN"
Else

oDesc = InputBox("Custom Material Description",  "User Input Material", oDesc)
oDType = InputBox("Custom Material Description",  "User Input Material", oType)

End If

End Sub

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

Post to forums  

Autodesk Design & Make Report