- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I am trying to get the color "Magenta" in the following code but I do not know which index I need to insert to get it.
Writing string: Item("Magenta") does not seem to work.
The original code is in the link below and there is a string used to define the color but it does not seem to work for all colors:
If ThisDoc.Document.DocumentType <> DocumentTypeEnum.kPartDocumentObject Then MsgBox("A Part Document must be active for this rule to work. Exiting.", vbCritical, "") Exit Sub End If Dim oPDoc As PartDocument = ThisDoc.Document oPDef = oPDoc.ComponentDefinition 'try to find/get the named face Dim oNEs As NamedEntities = iLogicVb.Automation.GetNamedEntities(oPDoc) Dim oOutsideFace As Face = oNEs.FindEntity("OWH1") If IsNothing(oOutsideFace) Then MsgBox("Could not find a face named 'OWH1'.", vbCritical, "") Return End If 'try to get the 'Appearance Assets Magenta Dim oDocAppAssets As AssetsEnumerator = oPDoc.AppearanceAssets Dim oLibAppAssets As AssetsEnumerator oLibAppAssets = ThisApplication.ActiveAppearanceLibrary.AppearanceAssets Dim oMagenta As Asset Try oMagenta = oDocAppAssets.Item(13) <---- ?? Catch oMagenta = oLibAppAssets.Item(10) Catch MsgBox("Could not find Appearance Asset named 'Magenta'.", vbCritical, "") Return End Try oOutsideFace.Appearance = oMagenta
Tom
Solved! Go to Solution.
Link copied