How to add a new parameter for all Inventor drawings, parts and assemblies

How to add a new parameter for all Inventor drawings, parts and assemblies

mdemarchiB7LW7
Community Visitor Community Visitor
213 Views
2 Replies
Message 1 of 3

How to add a new parameter for all Inventor drawings, parts and assemblies

mdemarchiB7LW7
Community Visitor
Community Visitor

Is it possible to add a string parameter using ilogic rules?
If so, what would be the syntax to write?

ty ,
Matteo

0 Likes
214 Views
2 Replies
Replies (2)
Message 2 of 3

marcin_bargiel
Advocate
Advocate

eg.

Dim doc As Document doc = ThisDoc.Document Dim pcd As PartComponentDefinition pcd = doc.ComponentDefinition For i = 1 To j : Try : If Parameter("mark_N" & i) <> "xy1" Then : End If : Catch : doc.ComponentDefinition.Parameters.UserParameters.AddByValue("mark_N" & i, "", "Text") : End Try : Next

Vote for REPLACE VARIES !
REPLACE VARIES
0 Likes
Message 3 of 3

C_Haines_ENG
Collaborator
Collaborator

This will create a new user parameter on all open documents:

 

For Each oDoc As Document In ThisApplication.Documents.VisibleDocuments

	Try
		oValue = oDoc.ComponentDefinition.Parameters.UserParameters.Item("Test")
	Catch
		oValue = oDoc.ComponentDefinition.Parameters.UserParameters.AddByValue("Test", "This is a Test", "Text")
	End Try

Next

 

 

0 Likes