Matt,
A shot in the dark since I only have a general idea of what your are trying to do.
As I understand acet-ss-drag-rotate, it returns the rotation angle in radians. As I
understand acet-ss-drag-move, it returns the point picked. So maybe you could use
drag-rotate first, then drag-move in some fashion to get the point you are looking
for.
Regarding your original question about lastpoint, from what I've seen the lastpoint
var is not updated when a point is picked in response to a command call within a lisp
routine. Which confirms what you found. In fact, I think the issue is more general
than that.
Command: (getvar "lastpoint")
(33415.4 -6632.55 0.0)
Command: (getpoint)
(29944.5 -6991.13 0.0)
Command: (getvar "lastpoint")
(33415.4 -6632.55 0.0)
Joe Burke
"Matt W" wrote in message news:5147708@discussion.autodesk.com...
The rubber band is what I currently use.
The reason I wanted to do some sort of ghosting is so that the end-user would have an
idea how much space would be taken up by placing a homerun on an electrical drawing.
Some drawings can become extremely congested. The ghosting would help the user
determine the best location to place the homerun and whether or not the homerun will
end up overlapping some other critical piece of information making it harder to read.
Basically what I want to do is this:
1) Pick a starting point PT1 (this would be the tail end of the leader - the part
connected to the receptacles shown in the ima ge). (this part I already have done)
2) Use some sort of ghosting (or a dummy block) that would represent the approximate
area that the homerun would be taken up. (This is the part that is driving me crazy).
I've looked into acet-ss-drag-rotate - which works great - but I'm running into the
same problem; I can't get the last point - PT2 - selected when rotating. I need tha
t second point so I know where to start the leader.
When I use (setq pt2 (getvar "lastpoint")) and then draw a line for example from
PT1 to PT2 I get a zero length line.
3) Draw the homerun leader and insert the attributed block for amps, poles, panel,
etc... (this part I have)
4) Delete the dummy block (easy enough to do)
[img src="@105604"]
"Kent Cooper" wrote in message
news:5147655@discussion.autodesk.com...
Would a rubber-band showing where the eventual Line will go be enough for
you, even if it doesn't drag the stuff you're rotating? You can add a
rubber-band reference in (getpoint):
(command "rotate" HR_group "" pt1 (setq pt2 (getpoint pt1 "Rotation:
")))
(command "line" pt1 pt2 "")
--
Kent Cooper
"Matt W" wrote...
It works, but it doesn't show the ghosted image of what I'm rotating.
Got any other ideas??
Matt W
"Kent Cooper" wrote...
Try something like this (untested), saving pt2 as you pick it for the
rotation:
(command "rotate" HR_group "" pt1 (setq pt2 (getpoint "Rotation: ")))
(command "line" pt1 pt2 "")
--
Kent Cooper
"Matt W" wrote...
I'm trying to get the last point that is picked when using the rotate
command. I've tried (getvar "lastpoint") but it ends up being
the point the block was inserted. I'm drawing a blank here.
Here's my sn ippet of code below. Any help is appreciated.
(defun CreateHomerun ( / pt1 pt2 lts HR_group)
(setq lts (getvar "ltscale"))
(initget 1)
(while
(setq pt1 (getpoint "\n Pick first point of homerun.. "))
(command "-insert" "ghostblock" pt1 lts lts "")
(setq HR_group (ssadd))
(s sadd (entlast) HR_group)
(command "rotate" HR_group "" pt1 pause)
(setq pt2 (getvar "lastpoint")) ; gets insertion point of block
instead
(command "line" pt1 pt2 "")
)
)
Thanks in advance.
Matt W