Message 1 of 7
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi everyone,
Right now I am trying to create a note for our drawings that is customizable.
I have two External Rules to accomplish this, the first one is what I am working on today.
This External Rule creates the UserParameters I need for the second External Rule.
At the moment, the External Rule functions correctly but if it is ran more than once it re-creates the UserParameters with a "_1" at the end. I want this External Rule to recognize if the User Parameter already exists and move on to the next if it does.
My Knowledge is limited when it comes to this stuff.
Below is the first External Rule, any help would be greatly appreciated.
oMyParameter=ThisApplication.ActiveDocument.Parameters.UserParameters
oParameter = oMyParameter.AddByValue("Fastener", "", UnitsTypeEnum.kTextUnits)
oParameter = oMyParameter.AddByValue("Size", "", UnitsTypeEnum.kTextUnits)
oParameter = oMyParameter.AddByValue("Length", "", UnitsTypeEnum.kTextUnits)
oParameter = oMyParameter.AddByValue("Material", "", UnitsTypeEnum.kTextUnits)
oParameter = oMyParameter.AddByValue("Spacing", "", UnitsTypeEnum.kTextUnits)
oParameter = oMyParameter.AddByValue("Notes", "", UnitsTypeEnum.kTextUnits)
'set the list
MultiValue.SetList("Fastener" , _
"GASKETED TEK SCREWS", _
"TEK SCREWS", _
"RIVETS", _
"NUTS AND BOLTS")
'set the list
MultiValue.SetList("Size" , _
"#10""", _
"#12""", _
"#14""", _
"1/8""", _
"3/16""", _
"1/8""", _
"3/16""""unc", _
"1/4""""unc", _
"5/16""""unc", _
"3/8""""unc", _
"7/16""""unc", _
"1/2""""unc", _
"9/16""""unc", _
"5/8""""unc", _
"3/4""""unc", _
"7/8""""unc", _
"1""""unc")
'set the list
MultiValue.SetList("Length" , _
"-1/2""", _
"-3/4""", _
"-1""", _
"-1 1/4""", _
"-1 1/5""", _
"-1 3/4""", _
"-2""", _
"-3""", _
"")
'set the list
MultiValue.SetList("Material" , _
"MILD STEEL", _
"ALUMINUM", _
"STAINLESS STEEL")
'set the list
MultiValue.SetList("Spacing" , _
"HOLES PROVIDED ON DRAWING", _
"EVERY 6""", _
"EVERY 8""", _
"EVERY 12""")
'set the list
MultiValue.SetList("Notes" , _
"INCLUDE WASHERS", _
"INCLUDE LOCK-WASHERS", _
"USE NYLOCK NUTS", _
"USE NYLOCK NUTS/WASHERS", _
"USE GASKETED SCREWS", _
"USE WASHER HEAD SCREWS")
'update iprops
iProperties.Value("Custom", "Fastener") = Fastener
iProperties.Value("Custom", "Size") = Size
iProperties.Value("Custom", "Length") = Size
iProperties.Value("Custom", "Material") = Size
iProperties.Value("Custom", "Spacing") = Size
iProperties.Value("Custom", "Notes") = Size
'update the drawing/title block
'InventorVb.DocumentUpdate()
'iLogicForm.ShowGlobal("Fastener Detail")
Solved! Go to Solution.