Message 1 of 6
Not applicable
02-26-2019
02:15 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Not a programmer so bear with me.
I have started a rule which is run in an assembly to create/format user parameters of parts referenced from the assembly; it throws an error with the reference frame which I do not need to format anyhow. How do I exclude the rule from attempting a change to the reference frame?
Can "If Not TypeOf" be used with referenced documents or only occurrences? Or is there another/better way?
Part of my code below:
Public Sub Main() ' Get the active assembly document. Dim oAsmDoc As AssemblyDocument oAsmDoc = ThisApplication.ActiveDocument ' Iterate through all of the documents referenced by the assembly. Dim oDoc As Document For Each oDoc In oAsmDoc.AllReferencedDocuments ' Check to see if this is a part. If oDoc.DocumentType = kPartDocumentObject Then Dim oPartDoc As PartDocument oPartDoc = oDoc 'Dim oRefDocName = oDoc.DisplayName 'Dim oRefDocName = oDoc.DisplayName 'MessageBox.Show(oRefDocName,"The component being updated is") CreateFormatG_L(oPartDoc, newParam, userParams) CreateFormatG_W(oPartDoc, newParam, userParams) CreateFormatG_H(oPartDoc, newParam, userParams) CreateFormatG_T(oPartDoc, newParam, userParams) 'iProperties.Value(oModelName, "Project", "Vendor") = SheetNumber End If Next ThisDoc.Save MessageBox.Show("Finished updating Vendor Nos.") End Sub
Solved! Go to Solution.
