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: 

Controlling the behaviour of input boxes

1 REPLY 1
Reply
Message 1 of 2
cadmanagershat
233 Views, 1 Reply

Controlling the behaviour of input boxes

On our drawings we currently use a series of sketched symbols which contain the notes required for manufacturing purposes ie machining painting surface finish etc. There are always cases where these are not sufficient and need to be edited to suit.

I am attempting to create a single set of notes which are driven by an ilogic rule and form to allow the operator to customize the content based on the specific requirements of each different product.

My problem is that when using input boxes I would like to be able to choose when to edit these. At the minute whenever we use the form to alter any lines it will prompt to change each value that has been assigned an input box.

This is where I am at currently and other than the problem I have attempted to describe it is working great, or was until I started to try controlling the input boxes (see red text).

 iProperties.Value("Custom", "NOTE1")= "1." & " " & NOTE1
 iProperties.Value("Custom", "NOTE2")= "2." & " " & NOTE2
 iProperties.Value("Custom", "NOTE3")= "3." & " " & NOTE3
 iProperties.Value("Custom", "NOTE4")= "4." & " " & NOTE4
 iProperties.Value("Custom", "NOTE5")= "5." & " " & NOTE5
 iProperties.Value("Custom", "NOTE6")= "6." & " " & NOTE6
 iProperties.Value("Custom", "NOTE7")= "7." & " " & NOTE7
 If NOTE3 = "NONE" Then iProperties.Value("Custom", "NOTE3") = ""
 If NOTE3 = "NONE" Then NOTE4 = "NONE" 
 If NOTE4 = "NONE" Then iProperties.Value("Custom", "NOTE4") = ""
 If NOTE4 = "NONE" Then NOTE5 = "NONE"
 If NOTE5 = "NONE" Then iProperties.Value("Custom", "NOTE5") = ""
 If NOTE5 = "NONE" Then NOTE6 = "NONE"
 If NOTE6 = "NONE" Then iProperties.Value("Custom", "NOTE6") = ""
 If NOTE6 = "NONE" Then NOTE7 = "NONE"
 If NOTE7 = "NONE" Then iProperties.Value("Custom", "NOTE7") = ""
 If NOTE3 = "ZINC PLATE" Then iProperties.Value("Custom", "NOTE3")= "3." & " " & "ZINC PLATE BS EN ISO 2081 - Fe/Zn25/F" _ 
 & vbLf & "   (BLACK - TRIVALENT CHROMIUM COATING)"
 If NOTE3 = "SHOTBLAST" Then iProperties.Value("Custom", "NOTE3")= "3." & " " & "SHOTBLAST TO SPEC BS7079 SA2.5"
 If NOTE3 = "PHOSPHATE" Then iProperties.Value("Custom", "NOTE3")= "3." & " " & "PHOSPHATE TO DEF STAN 03-11"
 If NOTE3 = "SHOTBLAST" And NOTE4 = "AREAS TO BE MASKED PRIOR TO" Then iProperties.Value("Custom", "NOTE4")= "4." & " " & NOTE4  & " " & NOTE3 & " & PAINT" _ 
 & vbLf & "    a. TAPPED HOLES" _
 & vbLf & "    b. ALL MACHINED SURFACES UNLESS STATED" _
 & vbLf & "    c. ANY SURFACE OR FACE INDICATED THUS" 
 If NOTE3 = "PHOSPHATE" And NOTE4 = "AREAS TO BE MASKED PRIOR TO" Then iProperties.Value("Custom", "NOTE4")= "4." & " " & NOTE4 & " PAINT" _ 
 & vbLf & "    a. TAPPED HOLES" _
 & vbLf & "    b. ALL MACHINED SURFACES UNLESS STATED" _
 & vbLf & "    c. ANY SURFACE OR FACE INDICATED THUS" 
 If NOTE3 = "ZINC PLATE" And NOTE4 = "AREAS TO BE MASKED PRIOR TO" Then iProperties.Value("Custom", "NOTE4")= "4." & " " & NOTE4 & " PAINT" _ 
 & vbLf & "    a. TAPPED HOLES" _
 & vbLf & "    b. ALL MACHINED SURFACES UNLESS STATED" _
 & vbLf & "    c. ANY SURFACE OR FACE INDICATED THUS" 
 If NOTE4 = "MATERIAL TO BE" Then question = MessageBox.Show("DO YOU WANT TO EDIT NOTE 4?", "YES OR NO",MessageBoxButtons.YesNo,MessageBoxIcon.Question)
 If question = vbYes Then iProperties.Value("Custom", "NOTE4")= "4." & " " & NOTE4 & " " & InputBox("WHAT IS YOUR MATERIAL SPEC", "MATERIAL", "XXXX")
 If question = vbNo Then 
 End If
 If NOTE5 = "MATERIAL TO BE" Then iProperties.Value("Custom", "NOTE5")= "5." & " " & NOTE5 & " " & InputBox("WHAT IS YOUR MATERIAL SPEC", "MATERIAL", "XXXX")
 If NOTE1 = "USER ENTRY" Then iProperties.Value("Custom", "NOTE1")= "1." & " " & InputBox("WHAT IS THE REQUIREMENT", "CUSTOM TEXT", "XXXX")

Say the material has been called plastic so I would like it to remain so on selection of "no". So If question = vbNo Then leave as is.

I realize that there are many shorter ways of doing what I have achieved so far but as I am currently self teaching then I am more than happy with what I have written and would appreciate if anybody could help me in terms that I will be able to understand and using the original code.

Thanks.

1 REPLY 1
Message 2 of 2

Anyone help on this one?

I must admit I am struggling somewhat here. I've tried running seperate rules triggered by certain conditions but cannot get the input boxes to behave in the way I need them to.

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

Post to forums  

Autodesk Design & Make Report