Assign color using Design View Representation at part level

Assign color using Design View Representation at part level

RoyWickrama_RWEI
Advisor Advisor
254 Views
2 Replies
Message 1 of 3

Assign color using Design View Representation at part level

RoyWickrama_RWEI
Advisor
Advisor
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 = "Orangre"
		End If
	End If
Next

 

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

adam.nagy
Autodesk Support
Autodesk Support

Hi,

 

Since you are looking for "Default" design view representation, I assume you are working in an assembly document.

There the parts are represented by component occurrences, so you have to set their colour through that, e.g.:

 

Component.Color("PartWithHole2016:1") = "Orange"

 

Cheers,

 



Adam Nagy
Autodesk Platform Services
Message 3 of 3

adam.nagy
Autodesk Support
Autodesk Support

The same question can be found here:

http://forums.autodesk.com/t5/inventor-customization/assign-color-using-design-view-representations-...

 

So let's continue there.



Adam Nagy
Autodesk Platform Services
0 Likes