iLogic: How to set DrawingCurve.Color to "ByLayer"

iLogic: How to set DrawingCurve.Color to "ByLayer"

j.pavlicek
Collaborator Collaborator
914 Views
2 Replies
Message 1 of 3

iLogic: How to set DrawingCurve.Color to "ByLayer"

j.pavlicek
Collaborator
Collaborator

Hello,
how to change DrawingCurve.Color (back) to "ByLayer" with iLogic?

Dim oBlue As Color
oBlue = ThisApplication.TransientObjects.CreateColor(0, 0, 255) 'blue
Dim oCurve As DrawingCurve
oCurve.Color = oBlue 'Set Drawing Curve Color to blue

oCurve.Color = ??? ' Set (back) to ByLayer

Thanks for help.



Inventor 2022, Windows 10 Pro
Sorry for bad English.
Accepted solutions (1)
915 Views
2 Replies
Replies (2)
Message 2 of 3

JhoelForshav
Mentor
Mentor
Accepted solution
Message 3 of 3

j.pavlicek
Collaborator
Collaborator

For completion:

There is Color.ColorSourceType Property which sets source of the color (as I understand it) when no-color is set.

	Dim oCurve As DrawingCurve
	oCurve.Color = Nothing
	Logger.Debug(oCurve.Color.ColorSourceType.ToString) 'Returns kLayerSource, because this is a default setting for my document
	oCurve.Color.ColorSourceType = kLayerColorSource 'But you can set it manually too

 Possible Color Source Types are:

  • kAutomaticColorSource
  • kLayerColorSource
  • kOverrideColorSource (this is returned in case of oCurve.Color = oBlue)
  • kSheetColorSource


Inventor 2022, Windows 10 Pro
Sorry for bad English.