Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations IDS on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

A toolbar and a lisp question

Status
Not open for further replies.

DrPipes

Mechanical
Apr 19, 2004
4
I'm having problems creating a toolbar macro.
I want to change layers, insert a block (for a custom leader arrow) and then spline the leader line.

This works to just insert the block and draw the leader:

^C^C-i c:/plbg/l3.dwg ^C^Cdimldrblk L3 qleader;

When this is done, I don't see the block inserted, it just draws the leader and I can rotate it to any angle I want, but I have to hit the spacebar to change to spline, and it draws it on whatever layer I'm on.

This makes the layer, moves to it and inserts the block but I have to hit enter to get past the rotation angle, scale factor and then it stops with the leader arrowhead inserted with no tail... Also need to figure out how to make it spline without hitting the spacebar:

^C^C-l m p-text c 6 ;;; -i c:/plbg/l3 ^C^Cdimldrblk L3 qleader;

What am I doing wrong?


I'm also trying to find a lisp routine to calculate invert elevations. I've looked at every lisp site I can find thru search engines, but no luck. What I need it to do is really pretty simple. When it's started I need to:
Input an elevation
It then would do a qleader from a point I pick and write the elevation.
It would then ask what slope (either 1/8"/ft or 1/4"/ft)and if I want to slope up or down.
Then wait for me to select a point to start calculating from. (starting point elevation +/- (distance * 0.0104 or 0.0208)).
When I select another point it would calculate the drop or rise.
Then it would do another qleader and write the answer, remember that value and wait for the next point to calculate or exit the command.

If somoene could tell me where I could find something similar to that, it would be greatly appreciated.
 
Replies continue below

Recommended for you

Hi drpipes,

here are some "causes for thought"

^C^C-la;m;p-text;_colour;6;;;_-insert;c:/Your.dwg;\;;;^C^C_dimldrblk;Your Arrow;_leader;\\f;s;;;;

I hope that's a right step in the right direction...

Lothar



ADT 2004
ACAD 2002
 
Close, but no cigar.

When I use the macro you suggested, it inserts the block and then I can do a splined leader, but it won't erase the original block insert and it won't let me pick 3 points for the splined leader. When I pick the second point, it draws the leader with a small arc.

Thanks, you helped me over one of the humps.
 
Drpipes,

maybe You have to write a lispcode. I can't.

"... but it won't erase the original block insert .." I'm sorry, [sadeyes]I don't understand it exactly. What do You want to erase?


For a 3 points splined leader You have to take ^C^C_dimldrblk;Your Arrow;_leader;\\\f;s;;;;

Lothar

ADT 2004
ACAD 2002
 
Maybe I need to explain my issue a little better. We know in order to use a custom arowhead you first have to insert a block of the arrowhead and then, using dimldrblk you can define it as an arrowhead. This is my original macro:

^C^C-i c:/plbg/l3 ^C^Cdimldrblk L3 qleader;

This just defines the block (adds it to the dwg) without actually drawing it and will then draw the leader. It works fine, but I have to manually make or switch to the text layer, click the toolbar button, hit space and switch to spline, then draw the leader. I want to automate the whole process.

When I click the button, I want to:

1. Switch to the text layer or if it's not been made, make it. That's where I got this: ^C^C-l;m;p-text;c;6;;;

2. Insert my arrowhead block into the dwg, but I don't want it drawn... I just want it defined in the dwg.

3. Switch to spline.

4. Draw the leader.

Your first suggestion:

^C^C-la;m;p-text;_colour;6;;;_-insert;c:/Your.dwg;\;;;^C^C_dimldrblk;Your Arrow;_leader;\\f;s;;;;

Makes the layer, inserts the block and draws it (not just define it) and then it will let me draw a 2 point leader (instead of a 3 point leader) and then it will draw a small arc after I right click to finish the command.

So I tried this to erase the inserted block:

^C^C_-la;m;p-text;_c;6;;;_-i;c:/plbg/l3.dwg;\;;;erase;last;;;^C^Cdimldrblk;L3;qleader;\\f;s;;;

Makes the layer, inserts the block and draws it (not just define it) erases it and then it will draw a 2 point leader (instead of a 3 point leader) and it won't spline.

I appreciate the help you have given me so far. Maybe with this blow by blow of what I want it to do and what it is doing will help either you or someone else help me get this working correctly.

Again, I appreciate the help.
 
ok, drPipes,
next attempt:

1. I agree with You

2. Insert a block, and erase it again (just define):
^C^C_-insert;c:/plbg/l3.dwg;0,0,0;;;;_erase;_last;;
-> specify the insertionpoint -> there's no need to click

3. You can't switch to a spline

4. Your error (IMHO) is, that You want to work with "_qleader". Use "_leader" -> 3 points-> form spline-> write mtext-> <ok>

I tried to explain that in my previous reply.
^C^C_dimldrblk;l3;_leader;\\\f;s;;;;

So my suggestion is:
^C^C_-la;m;p-text;_c;6;;;_-insert;c:/plbg/l3.dwg;0,0,0;;;;_erase;_last;;^C^C_dimldrblk;l3;^C^C_leader;\\\f;s;;;;

OK? If not, reply...

Lothar


ADT 2004
ACAD 2002
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor