Arc Circuiting Tool Macro Issue

Arc Circuiting Tool Macro Issue

Anonymous
Not applicable
971 Views
8 Replies
Message 1 of 9

Arc Circuiting Tool Macro Issue

Anonymous
Not applicable

I am trying to develop a new company circuiting tool for current AutoCAD 2018 that mimics our legacy toolbar circuiting tool.

 

Can anyone tell me how to write the marco for this command sequence:

 

Command:  _arc Specify start point of arc or [Center]:  <Osnap on>

Specify second point of arc or [Center/End]: e

Specify end point of arc:

Specify center point of arc or [Angle/Direction/Radius]: d Specify tangent

direction for the start point of arc:

 

*^C^C^P-LAYER S EL-CIRCUITING;;(c:bulge) 

(AutoCAD 2008 Command sequence)

 

The tool I have developed so far uses the following macro:

 

*^C^C^P-LAYER S EL-CIRCUITING;;_arc;(c:bulge) AutoCAD 2017-2018 doesn't recognize the (c:bulge) command. 

 

The problem I am having is when you pick the 2nd point for the arc, it doesn't stay connected to the 2nd point. Instead, it jumps ahead of the 2nd snap point & doesn't stay connected the the 2nd point.

 

Stumped & confused Smiley Frustrated

 

 

0 Likes
Accepted solutions (1)
972 Views
8 Replies
Replies (8)
Message 2 of 9

Kent1Cooper
Consultant
Consultant
Accepted solution

@Anonymous wrote:

 

....

 

*^C^C^P-LAYER S EL-CIRCUITING;;_arc;(c:bulge) AutoCAD 2017-2018 doesn't recognize the (c:bulge) command. 

.... 


That's calling for a custom-defined command called BULGE, which must be defined in some .LSP file somewhere.  It would contain, as the beginning of the definition:

 

(defun C:BULGE ....

 

[not case-sensitive].  If you can find that file, and APPLOAD it or have acaddoc.lsp load it in every drawing, presumably it should work.  If not, you can build in the inputs to the start/end/tangent-direction way of making an Arc, something like [untested]:

 

*^C^C^P-LAYER S EL-CIRCUITING;;_arc;\_e;\_d

Kent Cooper, AIA
Message 3 of 9

Anonymous
Not applicable

Thanks Kent!

Your macro works GREAT without the need for a .LSP file!!! Smiley Very Happy

 

 

0 Likes
Message 4 of 9

Anonymous
Not applicable

Kent,

My next issue is to create a Underfloor circuiting tool macro with a "DASHED2" linetype.

 

Here's the macro I have so far that doesn't work in newer AutoCAD 2017-2018:

 

*^C^C^P-LAYER S EL-CIRCUITING;;(SET-LINE "DASHED2")(_arc;\_e;\_d)

 

The newer AutoCAD 2017-2018 doesn't recognize the "SET-LINE" command in the macro. It comes back with "error: no function definition: SET-LINE"

 

Corey Barge

0 Likes
Message 5 of 9

Kent1Cooper
Consultant
Consultant

@Anonymous wrote:

.... 

Here's the macro I have so far that doesn't work in newer AutoCAD 2017-2018:

 

*^C^C^P-LAYER S EL-CIRCUITING;;(SET-LINE "DASHED2")(_arc;\_e;\_d)

 

The newer AutoCAD 2017-2018 doesn't recognize the "SET-LINE" command in the macro. It comes back with "error: no function definition: SET-LINE"

 

....

That must be a custom function you had defined in an earlier version -- it's not either a native command name nor an AutoLisp function name.  But if all it does is set the current entity linetype, you can do that with the appropriate System Variable used like a command name.  And you don't want those parentheses around the Arc part at the end.  Try something like [untested]:

 

*^C^C^P-LAYER S EL-CIRCUITING;;CELTYPE DASHED2 _arc;\_e;\_d

 

That does leave me with the question of setting CELTYPE back.  If you're always completing a single Arc with that tangent-direction last option, you could build in the pause for the pick for that, and then set it back:

 

*^C^C^P-LAYER S EL-CIRCUITING;;CELTYPE DASHED2 _arc;\_e;\_d;\CELTYPE BYLAYER

 

[That assumes BYLAYER is what you want to set it back to.]

 

No, actually, I struck that out because that's always going to leave you with DASHED2 as the current linetype, since it repeats automatically, and the point where you could cancel and stop the repeating is at the Arc command, so it will have changed that again.  It could be better to give the Arc that linetype after it's drawn, and not change the System Variable setting at all:

 

*^C^C^P-LAYER S EL-CIRCUITING;;_arc;\_e;\_d;\_.CHPROP _L;;_LT DASHED2;;

 

An advantage of that approach over setting CELTYPE is that in a CHPROP command, you don't need to even have the linetype loaded in the drawing yet -- it will find it.

Kent Cooper, AIA
0 Likes
Message 6 of 9

Anonymous
Not applicable

Kent,

Your *^C^C^P-LAYER S EL-CIRCUITING;;_arc;\_e;\_d;\_.CHPROP _L;;_LT DASHED2;; macro works BEAUTIFULLY!

My Employer & I are grateful for your help on this! 

 

You Rock, Kent!!! Smiley Very Happy

 

Corey Barge

0 Likes
Message 7 of 9

scot-65
Advisor
Advisor
I'm afraid there is a built-in time bomb in Kent's macro.

What happens when one accidentally starts this macro
and realizing that they did not want to run this, they will
[Esc] to halt the action?

Actually it will be the ARC command that will cancel and
the CHPROP will change the last entity that was added to
the data base, whatever that may be.

Humm... Been there, done that.
No, and it does not affect how fast one hits that [Esc] button either!

I would suggest creating a LISP command instead.
I am a believer of directing the AutoCAD-generated object
to the desired property/properties in lieu of setting/restoring
the environment, then allow AutoCAD generate the object.

But either method is acceptable once the user passes the
test and enters into the "body" of the program:
(if (and
(setq p1 (getpoint...
(setq p2 (getpoint p1...
(setq p3 (getpoint p2...
);and
(progn
...
);progn
);if

???

Scot-65
A gift of extraordinary Common Sense does not require an Acronym Suffix to be added to my given name.

0 Likes
Message 8 of 9

Kent1Cooper
Consultant
Consultant

@scot-65 wrote:
I'm afraid there is a built-in time bomb in Kent's macro.

What happens when one accidentally starts this macro and realizing that they did not want to run this, they will [Esc] to halt the action?

Actually it will be the ARC command that will cancel and the CHPROP will change the last entity that was added to the data base, whatever that may be.
....

It doesn't work that way for me [Acad2016 here] -- ESCape simply cancels the Arc command and  the macro, and it does not  go on to change the last object's linetype.

Kent Cooper, AIA
0 Likes
Message 9 of 9

Anonymous
Not applicable

Scot,

Thank you for your warning about Kent's Circuiting Macro for a "DASHED2" Linetype.

I used Kent's macro for 2 Circuiting toolbar tools in AutoCAD 2017.

 

I tested your scenario. I first used the Continuous Linetype Circuiting toolbar macro, then clicked on the "DASHED2" Linetype Circuiting toolbar macro and then pressed [Esc] to halt the action. The previously drawn Continuous Linetype Circuiting Arc did not change.

 

Kent’s "DASHED2" Linetype Circuiting tool macro draws the Continuous Linetype Arc, then changes it to "DASHED2" Linetype upon completing the Arc command. 

 

I also drew several Arcs using the Continuous Linetype Circuiting toolbar macro. I then executed the "DASHED2" Linetype Circuiting toolbar macro, then hit [Esc]. Still, all previously drawn Arcs did not change.

 

I Also Created AutoCAD 2018 Circuiting Toolpallet .LSP Tools Using the Continuous Linetype Circuiting toolbar macro & Just changed the Underfloor Circuiting Pallet tool Properties to come in with "DASHED2" Linetype.

Thanks for your input,

 

Corey Barge

 

0 Likes