I wonder if there is a script, add on, etc to make this a thing.
By this I mean that items would automatically fall into their corresponding layer based on their characteristics.
For example: You got a layer named “hatch” with red color.
So all hatches you do with red color will fall into that layer no matter what.
Now you make a circle, it falls under the layer “circle”.
etc etc. There could be custom settings so that circles maybe fall into the “curves” layer. In this way you can have pre arrenged profiles for your documents.
Its very tedious to be changing every object you draw or model into a specific layer.
Anyone has any workarounds?
for a simpler form of what you want, you could make a macro or a new command which would consist of 2 given commands, SelHatch and ChangeLayer if somebody still could add a hint how to address one specific named layer like for example hatch then it would work with one alias or one command without pop up but till then you at least could make that work to this point with one short cut or alias.
and if you want that to happen automatically each time this script or function would have to be appended to each command which creates anything, so that may not be so easy, but a script which runs over it once or each time you hit it which selects each entity placing it in the appropriate layer should work though, and combining color and kind of entity may also work but i have no idea how to script it so for now thats all i can offer here.
@Helvetosaur any idea how layers can be addressed directly without popup window asking which layer i want? something like ChangeLayer_ANYname_Enter?
i put both commands in the script box and it works just that it pops up the layer window asking which one i want.
yes it works now thanks @clement, have tried with quotes like _ChangeLayer"Hatch" and i think i also tried with a space between the command and the quoted name but never by the might of grayskull would i have came to the conclusion to use a hyphen. i think its a good idea at this point to read through the help file and have found it there, but i still cant figure out how to use this line for several commands for example something like
if run the above it just throws it all into the the Dim layer. i also tried _pause , _enter, _EnterEnd in between and ! before the second is that possible at all? and how would i implement that it creates such a layer if not existing?
holy moly a real pandeinós here
thanks guys for peeping in both work SelNone and None. when you have several objects stacked on top of each other and you click, the choose object pop up appears and it includes also None below maybe thats where it came from at least its somehow implemented.
seems to work, you can throw in any addition if you have the prepared Layer
Circle will not work since rhino does not know what a circle is but curves work.
just create a new command and throw the line above in exactly like that you can address it with one short cut and it whoops it all into the appropriate prepared layers hope that helps for now.
@Helvetosaur and @wim and whoever reads this, to one question from above again, how would i implement that it creates a layer within the script box when the layer is not already there, with a predefined name maybe even with a layer color?
@RichardZ, creating a layer would be macroed like this:
_-Layer _New "Hatch"
The good thing is, it creates the layer only once and when you run it again while the layer exists already, it does not create a new one. So you can run it without harm. The coloring would be done like this:
_-Layer _Color "Hatch" 255,0,0 _Enter
but the layer must exist for this to happen. I think if you do these kind of tasks with a script is better suited since it allows to control everything like colors, sublayers etc.
thanks @clement creating new layers works like that, but not defining the layer color even if the layers already exist. it still pops up a window asking what i want to address, i must add i am trying that on a mac so maybe the syntax is different there. can you double check if your line is correct and if so i will move this to a new topic for mac.
Note that the layer must exist for the color change. Only tested on windoze, maybe @Helvetosaur can take a look if the mac fails to script the command.
Hi @RichardZ - I’m trying to make a Macro button that will fill a closed curve with a specific Hatch (ANSI31) from my dropdown list of Hatches. I’d basically like to Left Mouse clicking my Macro Button to automatically do the following:
Fill the Closed Curve with my ANSI31 Hatch
Apply the subsequent ANSI 31 Hatch Object to my “Hatch Wall” Layer (regardless of whether it is the Current Layer)
Just can’t seem to figure out how to have a specific Hatch selection happen in the Macro. I’ve tried the Hyphen trick, I’ve tried GetString (which I think only works in Scripting) and I’ve tried _Pattern=ANSI31. None seem to do the trick.
Ultimate goal, for those following this thread, will be to use that as my Left Mouse Button selection on the Macro Button, and the Right Mouse Button will be a SOLID Hatch that will go in my “Hatch Solid” layer.
Ok, so, I have this macro, which will take a single OPEN CRV and offset, cap it, create a hatch, and place that hatch on a specified layer (Great for anyone out there who set design btw!)
! Offset _Pause _Pause _Enter
_Selnone _Sellast
-Hatch Pause Enter Pattern “ansi31” Enter
None Sellast
-ChangeLayer “Hatch Wall”
Here’s are two things I’d like to have it also do:
Set the Distance in the Offset to 3" (I’ve done this in the past but can’t seem to remember how – and I had a computer meltdown and lost my toolbars!)
I would like to be able to have the macro COPY THE ORIGINAL CRV, then go through its whole thing I have written up there, and then DELETE THE CLOSED CRV, and PASTE THE ORIGINAL CRV back into place. So I’d like it to look like this in the end: