Message 1 of 5
Run external rulel for child in assembly
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have an external rule that should be run on every part in an assembly. The rule is triggered form within the parts. The trouble I have is that I can't find a solution for the fact that the rule is now only working on the active document (which is always the assembly) instead of the part. This is because right now the code is as follows.
'Check document type, customize definitions to suit type, then either continue or exit if wrong type.
If oDocType = DocumentTypeEnum.kPartDocumentObject Then
oPDoc = ThisApplication.ActiveDocument
oPDef = oPDoc.ComponentDefinition
oParams = oPDef.Parameters
oCustomProps = oPDoc.PropertySets.Item("User Defined Properties")
ElseIf oDocType = DocumentTypeEnum.kAssemblyDocumentObject Then
oADoc = ThisApplication.ActiveDocument
oADef = oADoc.ComponentDefinition
oParams = oADef.Parameters
oCustomProps = oADoc.PropertySets.Item("User Defined Properties")
ElseIf oDocType = DocumentTypeEnum.kDrawingDocumentObject Then
oDDoc = ThisApplication.ActiveDocument
oParams = oDDoc.Parameters
oCustomProps = oDDoc.PropertySets.Item("User Defined Properties")
'Else Return
End If
My question is how to change the document to the document being edited. ThisApplication.ActiveEditDocument does not seem to work. I think it should be something like ThisDoc, but I can not find any info on how to use that for properties inside the parts.