Hi, I didn’t know whether macro related threads should be rhino for windows or for scripting. Since it does say for scripting or python, I figured I’d just categorize as windows.
- I do have a few questions. For some odd reason, I am having problems with the deleteobjectdata command either in macro, or just plain old using on command line, with _selname, choosing the objects which aren’t grouped anymore, but still behave that way. The group was a rectangle and two points. Then grouped, moved and rectangle deleted. Then I would like to delete any name the points have so I can repeat the macro with no problems.
It will work in macro or command for the rectangle, but the points are being funky. No object selected when I use the command and selname, and choose them from the dropdown vs. _-selname So, somethings funky. I have tried a lot of different ways now.
Are points able to be considered objects to delete their data? When I select the points separately and go to object properties and highlight/delete, it works. But for a macro button, I would like to get it to work. I would just keep all the points after I repeat the macro, and do selpoint and delete them at the end, but to do so I would need to eliminate all name data.
Maybe my problem is not figuring out a way to group the rectangle, point, and point without adding a name to them as objects first. Sellast will only select the last thing created. It is a closed curve, and from curve to point. Even if the group(a jig, for aligning points, to align revolved holes) is made from just a rectangle with line, it would be a closed curve trying to join to a line. Anywho. Heres the updated macro that does not name group, and the delete the rectangle macro, which leaves the 2 points. Which I would like to remove name data from. So after the ungroup/delete rectangle macro I have tried many combos with the _deleteobjectdata to no avail. It will work for the rectangle however when I split things up, and run it for the rectangle after ungrouping.
- In macros, is there anyway to copy a point, in its exact location, of the new spot it is in, which will be a variable. And to copy with no object name data? How about a something that allows to make a point relative 1 unit away, then relative point 1 unit back, delete both the original and the previousmade point, to essentially give you a copy in the same location?
I’ve been trying that but, it working out. Unless you made the point after you moved it, which will vary every time the macro is used. But what about the copy with no data? Or selecting a point, and somehow making a point relative to that point? I know this would involve funtions, which I’m not actually sure is possible with macros. Is there perhaps a command that takes a previously selected object, which you can use as a basepoint to enter a relative coordinate? The only problem is that the location will be variable each time the macro is used.
ANywho, any help is appreciated.
Here’s the macro for the crvs, points, and move. Following is the deletion of the rectangle
! _noecho _-setredrawoff
_-rectangle _3point=_yes
w-10,-8,0
w-10,-4.5,0
w-6.5,-4.5,0
enter
_sellast _-setobjectname 7rec
_-point w-9.125,-5.375,0 enter
_sellast _-setobjectname 7recpt1
_-point w-7.375,-7.125,0
_sellast _-setobjectname 7recpt2
_selnone _-selname 7rec
_-selname 7recpt1
_-selname 7recpt2
_group enter
_rotate
w-10,-8,0 _-setactiveviewport
right
w-10,-2.75,0
w-10,-8,7
enter
_-setactiveviewport
perspective
enter
_setredrawon
_move pause
The deletion of rectangle/ungrouping, and where I cannot add deletobjectdata and get it to work.
!_sellast _ungroup
_selnone
_-selname 7rec
_delete enter
Here is the details from 1 of the 2 points, in the new version of script that does not use group name, only grouping and sellast commands. The same problem exists in both versions though.
point
ID: f6cb9555-48b8-41c9-85fa-73b5d6d74774 (327)
Object name: 7recpt1
Layer name: Default
Render Material:
source = from layer
index = -1
Geometry:
Valid point.
Point at (0.875,0,18.625).
Here is from the version that utilizes object names for 3 objects. 1 curve and 2 points. For some reason, when I ungroup them, they are still grouped. Even though all 3 objects were selected and grouped at one time instead of 2 times. But it still works for what I wanted before which was to delete the rectangle, and keep the points. Now I want to have a copy of the points new location, with no object names or group names, so I can repeat the macro. Instead of doing them 1 by 1, and having to delete them each time, I would like to keep the points for visually eyeing and checking coordinates. Then delete them, put on layer and lock or whatever. It would be a better workflow.
point
ID: 58f8cc70-2377-4bfb-900b-34e2e8e40b42 (336)
Object name: 7recpt1
Layer name: Default
Render Material:
source = from layer
index = -1
Groups:
staggerspace
Geometry:
Valid point.
Point at (0.875,0,18.625).
point
ID: d600b5c0-d033-4792-8635-f1f1a9d8e5cd (337)
Object name: 7recpt2
Layer name: Default
Render Material:
source = from layer
index = -1
Groups:
staggerspace
Geometry:
Valid point.
Point at (2.625,0,16.875).
Thank you very much, I would really like to know other ways of doing things than deleting the object data. I think a way to make a copy or new object relative to a selname-object then deleting would help out in a lot of macros.