Solved! Go to Solution.
Solved by rjay75. Go to Solution.
Hi!
I'm not sure if i understand exactly what you want?
add your files here! ipt and idw
I want to be able to change the title of a drawing or part with this one rule. The rule is not for one specific part or drawing, but for basicly all the drawings we have. I'll attach two examples. So I want to be able to do these:
Problem is, when i run the rule from the part i get this message (attachment).
It's because you were using ThisDoc.ModelDocument which in a drawing document returns the part of the first baseview in the document. Use ThisDoc.Document instead.
doc = ThisDoc.Document Title = InputBox("Enter the title", "Title", iProperties.Value("Summary", "Title")) iProperties.Value("Summary", "Title") = Title If doc.DocumentType = kDrawingDocumentObject Then aModel = IO.Path.GetFileName(ThisDrawing.ModelDocument.FullFileName) iProperties.Value(aModel, "Summary", "Title") = iProperties.Value("Summary", "Title") End If InventorVb.DocumentUpdate()
Missed a line. This should use ThisDoc instead of ThisDrawing.
doc = ThisDoc.Document Title = InputBox("Enter the title", "Title", iProperties.Value("Summary", "Title")) iProperties.Value("Summary", "Title") = Title If doc.DocumentType = kDrawingDocumentObject Then aModel = IO.Path.GetFileName(ThisDoc.ModelDocument.FullFileName) iProperties.Value(aModel, "Summary", "Title") = iProperties.Value("Summary", "Title") End If InventorVb.DocumentUpdate()
Thanks a lot! And i understand what the problem was so that helps me getting furthur with iLogic, so that's great.