- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am trying to automate the text input required when starting a new project. There are certain pieces of information such as the job number, author, creation date etc. that are common to all drawings. I can do this easily from the Inventor API but I am trying to do it from an iLogic rule to simplify it for other designers.
Right now the iLogic rule is located in one of the drawings which filters down to the assembly that I am manipulating. I am collecting the variables from an excel sheet that acts as the design sheet. The excel sheet is accessed via filename and path, stores the information in an array which is then available for use within the drawing and the containing assemblies and parts which works very well.
Ideally I would like to push some of these gathered parameters to other open drawings for the project so I do not have to open them and run a similar rule just to gather and write information that has already been gathered in this rule.
This is the code I am using to access each open drawing:
Dim oDoc As Document Dim oDocSet As DocumentsEnumerator Dim oActiveDoc As Inventor.Document oActiveDoc = ThisApplication.ActiveDocument oDocSet = ThisApplication.Documents.VisibleDocuments oDocCheck = Len(ShortJobNumber) ThisApplication.ScreenUpdating = False For Each oDoc In oDocSet If oDoc.DocumentType = kDrawingDocumentObject Then If Left(oDoc.DisplayName,oDocCheck) = ShortJobNumber Then oDoc.activate MessageBox.Show(oDoc.displayname, "Title") oDoc.PropertySets.Item("Inventor User Defined Properties", "JobNumber")= JobNumber
oDoc.PropertySets.Item("Design Tracking Properties").Item("Designer") = DrawingInitials
'iProperties.Value(oDoc.displayname,"Inventor User Defined Properties", "JobNumber") = JobNumber
End If
End If
Next
oActiveDoc.Activate
ThisApplication.ScreenUpdating = True
I have tried several ways to access the iProperties but it either returns "Cant Find .idw" or it tells me that the property I am trying to access is read only.
It appears that I only have access to write parameters to documents directly related to the one the rule is contained in? Is there any way to do this or maybe to pass a variable from this rule to a rule in the other drawings that would be triggered by this rule?
Any ideas would be appreciated, thanks!
Solved! Go to Solution.