Looking for Inventor 2012 iLogic Code to change a Drawing Layer Color

Looking for Inventor 2012 iLogic Code to change a Drawing Layer Color

Anonymous
Not applicable
1,186 Views
2 Replies
Message 1 of 3

Looking for Inventor 2012 iLogic Code to change a Drawing Layer Color

Anonymous
Not applicable

I'm looking for some suggestions as to how to change the color of layer that will be used within a drawing files for special purposes.

 

Ideally the code will make the color Red, but change to Black prior to printing.

 

The "logic" behind the code currently is to differentiate a layer called "Burn" to a highly visible color for the purpose of review by others then, prior to printing, change the color to Black.  The firm I'm currently working for uses gray-scale B sided printers only.  The firm currently uses Blue for dimension and extension lines so to produce drawings that portray both type of objects "lightly".

 

Any tips, suggestions, errata or other methodology to accomplish this task is appreciated!

0 Likes
Accepted solutions (1)
1,187 Views
2 Replies
Replies (2)
Message 2 of 3

MjDeck
Autodesk
Autodesk
Accepted solution

Here's a line of code that will change a layer to red:

ThisDrawing.Document.StylesManager.Layers("Visible (ANSI)").Color = ThisApplication.TransientObjects.CreateColor(255,0,0) ' Red

And to black:

ThisDrawing.Document.StylesManager.Layers("Visible (ANSI)").Color = ThisApplication.TransientObjects.CreateColor(0,0,0) ' Black

These can be run manually.  They won't automatically change the color before or after printing.


Mike Deck
Software Developer
Autodesk, Inc.

0 Likes
Message 3 of 3

Anonymous
Not applicable

Thanks for your help, Mike.  Your suggestion should help in what I'm trying to accomplish.

0 Likes