Assign color using Design View Representations at Part Level

Assign color using Design View Representations at Part Level

RoyWickrama_RWEI
Advisor Advisor
336 Views
2 Replies
Message 1 of 3

Assign color using Design View Representations at Part Level

RoyWickrama_RWEI
Advisor
Advisor

I got help from WEB, but it is not still doing well.

 

 

Dim oApp As Inventor.Application
oApp = ThisApplication
Dim oDoc As Document
oDoc = ThisDoc.Document
Dim ocompdef As ComponentDefinition
ocompdef = odoc.ComponentDefinition

For Each oViewRep In ocompdef.RepresentationsManager.DesignViewRepresentations
	'If oViewRep.Name.Contains("Default") Then		'OK
	If oViewRep.Name = "Default" Then				'OK
	oViewRep.activate
		'DesignViewRepresen​tations.("Default").Activate
		oStockNumber = UCase(iProperties.Value("Project", "Stock Number"))
		If oStockNumber = "BASE PL" Or oBasePL = "BASE PLATE" Then
		iProperties.PartColor = "Orange"
		End If
	End If
Next

 

 

 

 Error Message.JPG

 

 

I request help.

 

 

0 Likes
337 Views
2 Replies
Replies (2)
Message 2 of 3

adam.nagy
Autodesk Support
Autodesk Support

Hi,

 

The only problem I had with the rule was this:

iProperties.PartColor = "Orangre"

 

I needed to modify it to 

iProperties.PartColor = "Orange"

 

Then it worked.

 

Cheers,



Adam Nagy
Autodesk Platform Services
Message 3 of 3

RoyWickrama_RWEI
Advisor
Advisor

Thanks.

0 Likes