Maybe need a macro maybe not, help!

hey all! I have been trying to program in some macros but I am having trouble with one aspect.

I have a macro that is producing a rectangle / box with a set height and I am trying to get an “L” shape 1.5 inches in and down from the top left corner of the rectangle.
anyone know the best way to do this?

Hi @Ela_Cohen
There are a few ways to do this it’d be best if you posted your file and macro attempt.

One way pre-draw your L shape and use the move command “assuming your rectangle edge is placed at 0,0,0”.
Use EvaluatePt and copy those coordinates from the command line and paste them into the macro editor. In the macro below you first select the L shape doesn’t matter where it is and then click the top left corner of the L.

move
pause
pause
1.500,3.500,0.000

Or use draw polyline and draw the L shape at the proper position.
Again use EvaluatePt to get your points of the L shape and copy those into the macro editor you must go in order either clockwise or counter clockwise I went clockwise in this macro

polyline
1.500,3.500,0.000
2.500,3.500,0.000
2.500,1.500,0.000
3.500,1.500,0.000
3.500,0.500,0.000
1.500,0.500,0.000
1.500,3.500,0.000

See attached file for reference.
RM

MacroExample.3dm (44.7 KB)

hi! my goal is to be able to have “L” shapes in all four corners of a rectangle that I program in (using an existing macro) in the same dimensions in for all four corners, and I mass produce these rectangles so they will be placed in various locations.

the goal is to be able to generate this:
image
in one step (number and arrow not included those are separate steps).

thanks

That sounds like an ideal application for Grasshopper…

I wouldn’t even know where to begin to try and get this, any tips?

thanks

Well, perhaps an explanation of what macros can and can’t do might help. There is a lot of detailed info here: Creating Macros [McNeel Wiki]

Basically, macros string together a series of Rhino commands in order to partially automate some tasks or set some options. However they are somewhat limited in what they can do. You can easily macro a the creation of rectangle of a given size and also the small "L"s at a specific location.

However, if you want to vary the size or proportion of the rectangle, or place it automatically in various different locations, a macro will no longer be adequate. At that point you need a script or something like Grasshopper (visual programming) that can take varying user input and output the objects you need, where you need them.

So, are the rectangles going to vary in size in any way? If not you can always macro one and then copy it to various locations afterward. But if you need something variable, then some sort of programming might be the way to go…

https://www.screencast.com/t/E7YvcoZhz

thank you!
yes, the rectangles will vary wildly in size (3in up to 120in) in both length and width.


I am trying to be able to do this because these are cut by a cnc machine and I need to be able to do them this quickly.

Hi @Ela_Cohen
As Mitch says you’re going to have to learn GH or Rhinoscript.
RM

I think this is perhaps best doable with a script. Even better if someone could make a custom ETO dialog with multiple value entry boxes (I don’t know how unfortunately).

Failing that, what can be done with a script is simply a series of command-line or popup single value questions - Length, Width, “L” size, Offset distance (of the “L”'s to the inside) and finally placement (click on screen or coordinate entry). This can be run from a button or an alias, and it can remember the last-used value entries for re-use.

So it runs like:

  • Punch the button
  • Type in the Length, Enter
  • Type in the Width, Enter
  • Type in the L Size - or if it’s constant it can be hard coded or just Enter to accept the default
  • Offset (as above)
  • Pick a point on the screen representing the lower left corner, center or whatever - done.