I am using the below rules to force iproperties to be populated when the dwg file is saved.
The input boxes are coming up when saving the document, but the details entered are not updating in iproperties.
Dim doc = ThisDoc.Document Dim oCreationTime As String = doc.PropertySets.Item("Design Tracking Properties").Item("Creation Time").Value If oProject = "" Then myparam = InputBox("Input Project No.", "Project No.", "-") If oDesigner = "" Then myparam = InputBox("Input Designer Name", "Designer", "-") If oDescription = "" Then myparam = InputBox("Input Description.", "Description.", "-") If oPartNumber = "" Then myparam = InputBox("Input Drawing Number.", "Drawing Number.", "-") If oDiscipline = "" Then d1 = InputListBox("Prompt", MultiValue.List("d1"), d1, Title := "Discipline", ListName := "Type") If oSecurityClass = "" Then d0 = InputListBox("Prompt", MultiValue.List("d0"), d0, Title := "Input Security Class", ListName := "Security Class") If oCreationTime < "01/01/2020" Then MessageBox.Show("Creation Time is empty", "Ilogic") InventorVb.DocumentUpdate() iLogicVb.UpdateWhenDone = True
Solved! Go to Solution.
Solved by A.Acheson. Go to Solution.
Solved by A.Acheson. Go to Solution.
With the rule you have posted there is no iproperties assigned to the variables you are checking. Here is an example .
Firstly assign the ilogic snippet for iproperty to the variable. Then check if it is blank, if found blank the input box allows the user to input the value then the iproperty is set to the variable value.
oDescription = iProperties.Value("Project", "Description")
If oDescription = "" Then
oDescription = InputBox("Input Description.", "Description.", "-")
iProperties.Value("Project", "Description") = oDescription
End If
Using the API property sets method this is what the description code looks like. The iLogic snippet shown above uses this behind the scenes.
Dim oDescription As String = doc.PropertySets.Item("Design Tracking Properties").Item("Description").Value
I don't know what the variables oProject and myparam are. But try the following code update
If oProject = "" Then myparam = InputBox("Input Project No.", "Project No.", "-")
change to
If oProject = "" Then oProject = InputBox("Input Project No.", "Project No.", "-")
and so on...
@A.Acheson , touched on how you would actually update the iProperties in the drawing file, but I have another question. I would also ask where this rule lives.
I would think, by the wording of your question, the rule would live in the drawing, but drawing parameters are not unique [make 2 sketches in a drawing and each will start with "d0" as the first dimension], so the use of multivalue list parameters d1 & d0 in the rule would make me think the rule lives in the part file [only if those inputlist boxes get displayed correctly, which I think you are confirming?]
Can you provide more information as to where the rule lives, what needs to be updated, and where you are looking for the information?
The best place to find this info is in the list of snippet categories on the left of the rule editor. You will find the tab iProperties, and find custom. When you right click the iProperty menu of any part/asssembly/drawing the tab headers is the first string value of the snippet And the name of the iProperty is the next.
iProperties.Value("Custom", "Entername")
iProperties.Value("Summary", "Category")
Can't find what you're looking for? Ask the community or share your knowledge.