Is there a way to associate layers to materials so when they are placed in a drawing they are automatically placed on the proper layer. I have line weights set for each individual layer and would like each material component to have its own line weight.
Solved! Go to Solution.
Solved by MjDeck. Go to Solution.
Solved by MjDeck. Go to Solution.
Solved by MjDeck. Go to Solution.
hello MjDeck,
To start I wish you a happy New Year.
I try your solution and it's work good on Inventor 2013. My computer work hard because we have very big layout assembly.
Have you got the same solution to use the appearance to assign to layers ?
Because all of my equipments are in stainless steel and I work for Layout and assign an appearance by zone.
Example : an assembly for Existing equipments with a specific color, an other assembly and color for customer suppler, ...
Thank you very much for you reply.
Best Regards
François.
This is a great bit of iLogic, very useful. Just wondering if its possible to assign a layer to a custom iProperty, rather than the material? I started a new thread here: http://forums.autodesk.com/t5/Inventor-Customization/Assign-Layers-based-on-Custom-iProperty/m-p/506...
I'm new to Inventor so I'm guessing I would need 2 layers for each material used. One for solid line and one for the hidden line.
@Anonymous wrote:You only want to use 00-Stone-Magenta (and maybe 00-Stone-Magenta-Hidden) in the section views, right?
Correct
I might have to include a table in the rule, where you can list the names of layers to be used in the projected and section views.
Projected views would be 00-Stone-Cyan & 00-Stone-Cyan-Hidden
Section, Auxiliary & Detail views would be 00-Stone-Magenta & 00-Stone-Magenta-Hidden
Correct for each material used in a drawing
hello MjDeck,
It does not seems to wrok for me, or am I missing a step?
I get the box with this text but no new layers? (see attachement)
I have an assembly with 1 part that contains the material "rubber"
what am I doing wrong?
I create new rule
and paste the code from message 48 (latest version)
then i go to ilogic browser and run rule
then I get a pop up screen that says
"the following layers where not found"
and mentions the layers it is suppose to make. i.e. "Rubber"
@TKRdam , the rule won't automatically create the layer for a material. You have to create that layer before running the rule. The idea is that you might want these layers to look different, probably with a different color. The rule doesn't know what color (or line type or weight) to choose.
It might be possible to change it to create layers (if not found) by copying the default Visible layer. Then it would be up to you to change the layer appearance after running the rule.
Thank you so much, I tried it out some time ago did not remembre I had to make the meterial layers myself
it does generate "materialname-hidden" layers.
it does not generate "materialname-view" layers
the view-layers are not useful for us. as I cannot write code is it easy to delete from the code?
that all layers from all views go to either:
materialname
materialname-hidden
and i only have to make the layer(s) "materialname" myself
@TKRdam , here's a new version of the rule. It includes some documentation and a new option. Change the line:
Const AllViewsTheSame As Boolean = False
to:
Const AllViewsTheSame As Boolean = True
This is near the top of the rule. If you make that change, then layers like "MaterialName-View" will not be required.
Hello MjDeck,
Thank you so much, this is much better.
the little adjustment for the view layers worked perfect
thank you for that!
as we have many many different materials and also new materials in our projects.
the workflow would be so much more workable if the rule makes a new layer from the existing materials
we dont need to change colours per material.
I dont know how to do it
maybe there is an easy hack you can give me just as you did with the true/false?
or tel me which part of the code to replace by a new code block you can provide?
I can olny ask and hope you are willing to do it.
thank you for the good work!
Tom Kroos
Our standard layer is "visible iso" Is it possible or not d'Or the rule to get the layer out of the drawing Standard by object defaults?
A workable solution would be that we enter the standard layer once in the rule and that the rule then works for that particular drawing.
Here's a version of the rule with a new option you can set to make it not require existing layers. As before, change this option to True:
Public Const AllViewsTheSame As Boolean = True
And now change this option to False:
Public Const RequireExistingLayers As Boolean = False
By default, it will create any required new layers by copying the Visible and Hidden layers of the drawing standard. Or you can edit the values of VisibleLineSourceLayerName and HiddenLineSourceLayerName if you want to use other layers instead.
The rule has a limitation that I hadn't noticed before: it doesn't do anything with the Visible Narrow and Hidden Narrow layers. Those are used for tangent edges.
Thank you for this reply,
however i am getting errors, see attachment (sorry it is in dutch)
line 201
line 211
line 334
line 340
"Thisrule is not declaired"
Tom
Tom,
Sorry about that. Are you running Inventor 2018 or earlier? Here's a new version of the rule that should work on all versions.
Can't find what you're looking for? Ask the community or share your knowledge.