02-19-2015
01:17 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
02-19-2015
01:17 AM
Hi there,
I'm trying to add some user parameters to a Inventor .dwg file through ilogic. I'd like to be able to add user parameter some of which will be string and some will be numbers.
I can't seem to find any help on the web or on the forums for this.
Could someone help me please?
thanks,
John
Solved! Go to Solution.
02-19-2015
04:22 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
02-19-2015
04:22 AM
Hi John,
You can add a user text parameter like this.
If you want it to be a multi-value parameter you'll need to create a new arraylist and add the arraylist itself as the value of the new parameter (replacing "InitialValue" in the example below:
Regards,
Luke
Dim oDrawDoc As DrawingDocument = ThisApplication.ActiveDocument Dim oDrawParams As UserParameters = oDrawDoc.Parameters.UserParameters Dim TestParam As UserParameter = oDrawParams.AddByValue("TestParam" , "InitialValue", UnitsTypeEnum.kTextUnits)
02-19-2015
05:17 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
01-19-2017
02:48 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
01-19-2017
02:48 AM
Great tip. But how can we delete it or rename it?
Cheers,
-Bertrand
“https://damassets.autodesk.net/content/dam/autodesk/logos/autodesk-logo-primary-rgb-black-small_forum.png”
01-19-2017
03:54 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
01-19-2017
03:54 AM
Like this:
Dim oDoc As Document = ThisApplication.ActiveDocument
Dim oParams As UserParameters = oDoc.Parameters.UserParameters
Dim TestParam As UserParameter = oParams.Item("TestParam")
TestParam.Expression = "NewText"
TestParam.Name = "NewName"
TestParam.Delete()
Consider using "Accept as Solution" / "Kudos" if you find this helpful.
- - - - - - - - - - - - - - -
Regards,
Mike
"Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live." - John F. Woods
- - - - - - - - - - - - - - -
Regards,
Mike
"Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live." - John F. Woods