- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello, I am trying to create a rule that will create custom iProperties & User Parameters for sub-assemblies & their piece parts. The intention is to make the custom iProperties as they fill in title block info. Also I am working on making a tool that will replace design assistant for design copy type projects. I have the majority of it working besides being able to create custom iProperties and User Parameters for the sub-assemblies and their piece parts. Any help would be appreatiated. Here is an example of what I was trying to do, this doesn't do anything, I went about it through oOccurences too but that wouldn't work, I don't think its allowing me to access ComponentDefinition though Occurences.
' Get the active assembly. Dim oAsmDoc As AssemblyDocument = ThisApplication.ActiveDocument ' Get all of the referenced documents. Dim oRefDocs As DocumentsEnumerator = oAsmDoc.AllReferencedDocuments ' Iterate through the list of documents. For Each oRefDoc As Document In oRefDocs 'Skipping any purchased or mfg parts / any parts that are not accessable If oRefDoc.IsModifiable() = True AndAlso oRefDoc.DocumentType = DocumentTypeEnum.kAssemblyDocumentObject Then oSubAsmParameter = oRefDoc.ComponentDefinition.Parameters.UserParameters 'Creating sub-assembly user parameters oParameter = oSubAsmParameter.AddByValue("CUSTOMER NAME-1", "", UnitsTypeEnum.kTextUnits) oParameter = oSubAsmParameter.AddByValue("CUSTOMER PO#", "", UnitsTypeEnum.kTextUnits) oParameter = oSubAsmParameter.AddByValue("END USER-1", "", UnitsTypeEnum.kTextUnits) oParameter = oSubAsmParameter.AddByValue("PARENT PRODUCT#", "", UnitsTypeEnum.kTextUnits) oParameter = oSubAsmParameter.AddByValue("PROJECT#", "", UnitsTypeEnum.kTextUnits) oParameter = oSubAsmParameter.AddByValue("SO#", "", UnitsTypeEnum.kTextUnits) oParameter = oSubAsmParameter.AddByValue("WORK ORDER#", "", UnitsTypeEnum.kTextUnits) Else End If Next
Solved! Go to Solution.