PDA

View Full Version : Lisp routine request: "Draw By Example"



matt.bachardy903119
2013-02-06, 10:46 PM
Hello,

I've been searching for a Lisp routine that behaves like the one in the old Softdesk 8 Auto Architect / Productivity Tools for R14, for use with ACAD 2000 (or above).

When invoked, it allows you to pick any entity, text, block, line - whatever - changes to the layer the entity is on and invokes the command. Example: You invoke the "Draw By Example" Command, pick a line on Layer "Door", then allows you to draw a line on the "door" layer. It worked the same with text, blocks, circles, etc.

Any help would be appreciated! Thanks....

pbejse
2013-02-07, 07:59 AM
Hello,

I've been searching for a Lisp routine that behaves like the one in the old Softdesk 8 Auto Architect / Productivity Tools for R14, for use with ACAD 2000 (or above).

When invoked, it allows you to pick any entity, text, block, line - whatever - changes to the layer the entity is on and invokes the command. Example: You invoke the "Draw By Example" Command, pick a line on Layer "Door", then allows you to draw a line on the "door" layer. It worked the same with text, blocks, circles, etc.

Any help would be appreciated! Thanks....

Question: what if you pick block? what is the command associated with that? Insert?

Here's the gist of it


(defun c:demo (/ objtype layer invoke)
(if (setq objtype (car (entsel "\Select Object:")))
(progn
(setq layer (cdr (assoc 8 (setq e (entget objtype)))))
(setq invoke (cdr (assoc 0 e)))
(setvar 'clayer layer)
(if (wcmatch invoke "*LINE")
(setq invoke (cadr
(assoc
invoke
'(("POLYLINE" "3DPOLY")
("SPLINE" "SPLINE")
("LINE" "LINE")
("LWPOLYLINE" "PLINE")
)
)
)
)
)
(apply 'command (list invoke))
)
)(princ)
)

Tom Beauford
2013-02-07, 06:20 PM
What version are you using? The ADDSELECTED command was added in the 2011 version.

greg.battin
2013-02-07, 06:44 PM
Kent cooper made a lisp routine that (in my opinion) is better than ADDSELECTED. His routine can be found here:
http://forums.autodesk.com/t5/Visual-LISP-AutoLISP-and-General/Add-Selected-Create-similar-object-for-ACAD-2007/m-p/2937680

~Greg

matt.bachardy903119
2013-02-07, 07:45 PM
I'm using ACAD 2012, and have the Dotsoft Toolpac add-on which includes a "draw by example" feature that works very well. Also, I use Revit 95% of the time for architectural work. ACAD is used for detailing and some limited architectural production work.

I have an ACAD 2000 setup a part-time draftsman is using, so I'm wanting to get that machine into a more efficient drafting machine until we can afford to upgrade to another seat of Revit/ACAD. I've brought over many, many time saving lisp routines to the ACAD 2000 machine, but really miss the the "draw by example" routine.

matt.bachardy903119
2013-02-07, 10:00 PM
Yes, if you pick a block, it inserts the block on the same layer as the block you picked at the same scale as the block you pick. The same with text - if you pick a text entity, the routine invokes the text command, allowing you to insert text in the same style, scale and layer as the text you picked to use.

I still have a Windows 98 machine running ACAD 14 / Softdesk Auto Architect 8 in operation and have spent a considerable amount of time digging through the lisp routines and menus and have yet to find the code for this. They've buried it quite well. Web searches have proved fruitless as well.

greg.battin
2013-02-08, 12:46 AM
Kent cooper made a LISP routine that (in my opinion) is better then ADDSELECTED found here: http://forums.autodesk.com/t5/Visual-LISP-AutoLISP-and-General/Add-Selected-Create-similar-object-for-ACAD-2007/m-p/2937680

~Greg

cadconcepts
2016-06-27, 04:27 PM
Hi All
Is it possible to add a reactor to Kent Cooper's "makemore.lsp" routine to have it restore the system variables back to their initial state? I love this routine but try as I might I cannot get it to restore the system variables. I have to manually do it. Any help is greatly appreciated. Thanks.
Manuel A. Ayala

Tom Beauford
2016-06-27, 05:08 PM
Hi All
Is it possible to add a reactor to Kent Cooper's "makemore.lsp" routine to have it restore the system variables back to their initial state? I love this routine but try as I might I cannot get it to restore the system variables. I have to manually do it. Any help is greatly appreciated. Thanks.
Manuel A. Ayala

Newer version located http://cadtips.cadalyst.com/match-properties/make-new-objects-with-existing-objects-properties
See if it's been fixed.

cadconcepts
2016-06-27, 07:02 PM
Hi Tom
I downloaded this version recently and it has the same problems as the earlier versions. I have in my arsenal of utilities one that stores system variables and one to restore them, but I am not able to get it to work this routine. This is why I am assuming that a reactor might be the solution. Thanks.
Manuel