Bubble Trouble

Bubble Trouble

Anonymous
Not applicable
347 Views
24 Replies
Message 1 of 25

Bubble Trouble

Anonymous
Not applicable
I want to create a menu button that calls qleader and applies a bubble to
the end. My Qleader settings are set to block referance, I have created a
circle with an attribute (called bubble) and setr up a button on my menu
bar. The command lilne is:
^C^CQleader;\\\bubble;@7<0;;;
Works great except... I can only insert the bubble at 0 degrees from the
last point. (or any other set angle that I choose.
I can retrieve the lastangle variable:
(setq lsta (getvar "LASTANGLE")
But I cannot sem to apply it to the end of my line. (the bubble is 14" in
diameter, inserted in model space, it scales down) hence the 7.
What I would like is to insert the bubble block @7
I'm missing something
Help?

Michael Hager
Stainless Incorporated
0 Likes
348 Views
24 Replies
Replies (24)
Message 21 of 25

Anonymous
Not applicable
Herman Mayfarth wrote in article
...
> David,
>
> > why you had ended the insert
> > command with a 'pause', but it wasn't the focus of my attention.
Removing
> > it allows a clean flawless operation in R13, R14, and A2K.
>
> As Mr. Turvill is so fond of pointing out, "that only works because the
open
> "COMMAND" is the last statement in the function.":) The single pause
allows
> only one attribute value to be entered (sloppy coding), so V1.3 does
this:
>
> (if (> (distof (getvar "acadver") 2) 14.1)
> (command "_.-INSERT" "MK_BUBL0" inspt sf sf 0.0);R15(?)
> (command "_.INSERT" "MK_BUBL0" inspt sf sf 0.0);R14 & R13
> )
> (while (=(logand(getvar "CMDACTIVE")1)1)
> (command pause))

Ah, HA! Now the picture becomes clearer. As to the pause, I didn't think
of attributes. On the other hand, it had crossed my mind, how they would
be answered if expected? Since I haven't used attributes in some time, I
am not up on them. In fact, I would have to study up on them as to making
them visible, etc.

>
> >Now why do you need 'texteval'? It works OK with or without it.
>
> Doesn't for me. Changing the first instance to:
>
> (setvar "TEXTEVAL" 0) causes the program to charge right through the
> attribute prompts, inserting the block with blank attributes:

I can see now that it would. I thought the texteval was just for
evaluating acadver.

> _.INSERT Block name (or ?) : MK_BUBL0 Insertion point: X scale

> factor <1> / Corner / XYZ: 1.000000000000000 Y scale factor (default=X):

> 1.000000000000000 Rotation angle <0>: 0.000000000000000
> Enter attribute values
> MARK1: \ MARK2: \<---gets interpreted as an
> Command: _.UNDO Auto/Control/BEgin/End/Mark/Back/: END
>
> Thanks for testing it with other releases.:)

*Testing* software is kind of my specialty, but not evaluating code as I
don't always understand it. I can run R12 (DOS), R13, R14, and R15
readily, and if hard pressed, I probably could still run R10 and R11. You
are welcome to send me something to test anytime, and time permitting, I
will get back to you promptly.
--
Dave D
lectromech@cyberportal.net
0 Likes
Message 22 of 25

Anonymous
Not applicable
David,

> You
> are welcome to send me something to test anytime, and time permitting, I
> will get back to you promptly.
>
Thanks for the offer. I will keep it in mind.

hm
0 Likes
Message 23 of 25

Anonymous
Not applicable
David...

While not a elegant as the simple menu macro I had hoped for, your solution
is short and sweet and works perfectly! I have included it in my startup
.LSP, put the bubble block in my template file and am happy as can be.

Thanks for your help!

Who knew that a simple problem like this would generate 20+ resonses in one
weekend?

Thanks again,

Michael Hager
Stainless Incorporated

David Doane wrote in message
news:01bf28cc$2d2c9880$e956d2d0@lms-1...
> Michael,
>
> It seems that leader and qleader are weird suckers, and they don't produce
> a 'lastangle' like other stuff does. So far, the best I could come up
with
> is as follows, and that is an AutoLISP program. You may have to modify
the
> 'insert' ending to handle your attribute, as I was simply inserting a
> blocked circle.
>
> (defun C:BUBBLE (/ pnt1 pnt2 pnt3 pnt4 ang1)
> (setq pnt1 (getpoint "\nStart point for arrow: ")
> pnt2 (getpoint pnt1 "\nNext point: ")
> pnt3 (getpoint pnt2 "\nNext point: ")
> ang1 (angle pnt2 pnt3)
> pnt4 (polar pnt3 ang1 7.0) ) ;setq
> (command ".leader" pnt1 pnt2 pnt3 "" "" "n")
> (if (= "15" (substr (getvar "acadver") 1 2))
> (command ".-insert" "bubble" pnt4 "" "" "") ;for A2K
> (command ".insert" "bubble" pnt4 "" "" "") ;for R14
> ) ;if
> (princ)
> )
>
> --
> Dave D
> (remove '-' for Email)
>
> Michael Hager wrote in article
> <801ugi$k5p8@adesknews2.autodesk.com>...
> > I will try the seperate command suggestion... have to get home right
now,
> > but I'll give it a shot on Monday morning. Thanks for the suggestions,
> I'll
> > get it right sooner or later.
> >
> > Michael Hager
>
>
0 Likes
Message 24 of 25

Anonymous
Not applicable
Herman,
For what its worth here are two versions of the default or picked point,
with rolling default thrown in.
I made them each commands so you can test them directly.
Of course they return 1, 0, or the point picked (which wouldn't work with
your entmake leader function) but I just wanted to illustrate the idea.
Its simple to do, (grread) is not necessary.

As for my extensive Xdata, I just matched what was attached to a leader
entity in my drawing, obviously overkill as you pointed out. I had a bit of
a time figuring exactly how to build that list and tracking down the various
codes, worth the time spent learning.

I wonder how many people have made their own leader commands,
and if any of these posts ask "Why bother?" I say, what did you do when
there was no Qleader? What would you do if there wasn't free fish?
I'm the type of lisper that would write my own version, just to figure out
how the other guy did it. Protected lisp, I throw right in the recycle bin.
I might run it first, and then write my own, to duplicate the features.
In other words, Write your own - And its YOURS!

But I digress.
Cheers,
P.Farrell

(defun c:bubdef ()
;;;
(if (= bubdef nil) (setq bubdef "STraight"))
(initget "Spline STraight")
(setq pathtype (getpoint (strcat "\nLeader Pathtype: Spline, STraight or Start Point <"
bubdef ">: ")))
(if (= pathtype nil) (setq pathtype bubdef))
(cond ((= pathtype "Spline" )(setq pathtype 1)(setq bubdef "Spline"))
((= pathtype "STraight")(setq pathtype 0)(setq bubdef "STraight"))
);cond
pathtype
;;;
)
;;;
(defun c:bubdef2 ()
;;;
(if (= bubdef nil) (setq bubdef "STraight"))
(initget "Spline STraight")
(if (= bubdef "STraight")
(setq pathtype (getpoint (strcat "\nLeader Pathtype: Spline or Start Point:
")))
(setq pathtype (getpoint (strcat "\nLeader Pathtype: STraight or Start Point:
"))))
(if (= pathtype nil) (setq pathtype bubdef))
(cond ((= pathtype "Spline" )(setq pathtype 1)(setq bubdef "Spline"))
((= pathtype "STraight")(setq pathtype 0)(setq bubdef "STraight"))
);cond
pathtype
;;;
)
0 Likes
Message 25 of 25

Anonymous
Not applicable
Peter,

> Its simple to do, (grread) is not necessary.

I managed to figure that out last night.. (duh):)

Thanks for the examples and constructive criticism.

hm
0 Likes