It will be highly beneficial for a quality control work if a lisp is designed in which after copying AutoCAD objects and pasting results to a specific color.
This will show that how many number of objects have been edited in a shop drawing.
Solved! Go to Solution.
Solved by hmsilva. Go to Solution.
Solved by hmsilva. Go to Solution.
Solved by hmsilva. Go to Solution.
Hi Bireshwar,
is required more explanation on "copying AutoCAD objects and pasting results to a specific color"
Copy/paste?
Are you going to use the command between dwg's?
Wouldn't be sufficient the copy command?
What type of entities you intend to copy, simple objects such as lines, arcs, polylines,.. or more complex objects such as blocks, inserts...?
If possible, attach a sample dwg exemplifying what you intend to do.
Henrique
Dear Henrique,
We only require to copy text in the same drawing and after copying only the color of the dtext/mtext changes to a particular color say for example red.
For better review we are hereby attching a snap for the same.
Best Regards,
Bireshwar
Quick and dirty...
(defun c:test ( / ENT S SS) (setq ss (ssadd) ent (entlast)) (if (setq s (ssget "_:L" '((0 . "*TEXT")))) (progn (command "_.copy" s "" pause pause) (while (setq ent (entnext ent)) (ssadd ent ss) ) (if ss (command "_.chprop" ss "" "_C" "1" "") ) ) ) (princ) )
HTH
Henrique
@Anonymous wrote:
Thanks a lot for the resolution. Will it be feasible if the red colored text will return to by layer after it has been edited.
You're welcome, Bireshwar
As a "demo"
(defun c:test ( / ENT HND STR) (if (setq hnd (car (entsel "\nSelect an annotation object: "))) (progn (setq ent (entget hnd)) (setq str (cdr (assoc 1 ent))) (command "_.ddedit" hnd) (while (> (getvar 'cmdactive) 0) (command pause) ) (if (not (wcmatch (cdr (assoc 1 (entget hnd))) str)) (command "_.chprop" hnd "" "_C" "bylayer" "") ) ) ) (princ) )
HTH
Henrique
Dear Henrique,
Good day and really a nice routine get a good customization. If a small objective is to be noted :
1. Edited text after pressing an enter seems correct and gets back to by layer.
2. Edited text without pressing an enter retains the RED color.
I am hereby attaching a snap for your reference.
@Anonymous wrote:
Dear Henrique,
Good day and really a nice routine get a good customization. If a small objective is to be noted :
1. Edited text after pressing an enter seems correct and gets back to by layer.
2. Edited text without pressing an enter retains the RED color.
I am hereby attaching a snap for your reference.
Bireshwar,
I can't reproduce that behavior, because to exit the editing inside the command "Test", you'll have to press the space bar or the enter, if you press the esc. will cancel the command...
Henrique
Hi Henrique,
Thanks for the update and yes its a valuable customization. Can we copy the text and the leader (as its a part of annotaion) to a red color instead of the text which will really make the tool very useful for quality check. I really missed out that we require text with leader copy to other areas of files.
Best Regards,
@Anonymous wrote:
Hi Henrique,
Thanks for the update and yes its a valuable customization. Can we copy the text and the leader (as its a part of annotaion) to a red color instead of the text which will really make the tool very useful for quality check. I really missed out that we require text with leader copy to other areas of files.
Best Regards,
Attach a sample dwg (not img) exemplifying what you are trying toaccomplish.
Henrique
Dear Henrique,
I have attached a sample dwg that illustrates why we are requiring this feature that may be helpful for quality checking any AutoCAD shop drawing either in MEP section or Architectural, Structural and Concrete. My points for validating this feature is stated underneath :
1. We have a common practice of copying similar text with leader (generally present in the same layer) rather than writing the same again as there may be 100's of text and annotations.
2. Many a times we forget to edit the copied text.
3. For piping generally parameters like BOP(Bottom of pipes), dia and other similar parameters are required for copying.
4. For ducting parameters like BOD (Bottom of duct) and various other parameters are required to be copies.
5. For Architectural,Structural similar parameters like elevation,wall thickness and many more others needs to be copies rather than texting the same.
For all the validations we generally require the leader to be copied as well as its the part of annotation (text+leader). Hope I have made the practical objectives clear that may be helpful for any CAD working domain.
Have a good day !!
Best Regards,
Bireshwar
Bireshwar.
just remember that, to the text color return to bylayer, you'll need to use the MyE routine, if you use juste the AutoCAD "ddedit" the color will not be changed...
(defun c:MyC ( / ENT S SS);; My Copy (setq ss (ssadd) ent (entlast)) (prompt "\nSelect Leader and Annotation to copy: ") (if (setq s (ssget "_:L" '((0 . "*TEXT,LEADER")))) (progn (command "_.copy" s "" pause pause) (while (setq ent (entnext ent)) (if (wcmatch (cdr (assoc 0 (entget ent))) "*TEXT") (ssadd ent ss) ) ) (if ss (command "_.chprop" ss "" "_C" "1" "") ) ) ) (princ) );; MyCopy (defun c:MyE ( / ENT HND STR);; My Edit (if (setq hnd (car (entsel "\nSelect an annotation object: "))) (progn (setq ent (entget hnd)) (setq str (cdr (assoc 1 ent))) (command "_.ddedit" hnd) (while (> (getvar 'cmdactive) 0) (command pause) ) (if (not (wcmatch (cdr (assoc 1 (entget hnd))) str)) (command "_.chprop" hnd "" "_C" "bylayer" "") ) ) ) (princ) );; MyEdit
HTH
Henrique
Dear Henrique,
Thanks a ton!! The routine served the workflow requirements. Henrique can you guide us with some good ebooks on Autolisp so that I can grab the topic well. Professionally I am a Java developer (web and desktop application) and have a bit of knowledge in the Autolisping. Please do suggest the IDE for carrying our healthy autolisping for example I ues Eclipse, Oracle JDeveloper and Netbeans IDE for carrying out Java developments. It will be of a major help.
Have a great day ahead 🙂
Hi Bireshwar,
some links
http://forums.autodesk.com/t5/Visual-LISP-AutoLISP-and-General/The-Visual-Lisp-Developers-Bible-by-D... http://www.afralisp.net/index.php
http://klobouk.fsv.cvut.cz/~chour/Lisp/Contents.htm
http://www.private.peterlink.ru/poleshchuk/cad/eng.html
http://www.lee-mac.com/programs.html
HTH
Henrique
And for an IDE
personally, I use the Autodesk VLIDE, for AutoLISP and Visual LISP, and it is pretty good.
Take a look at this Lee Mac tutorial
http://www.lee-mac.com/introtovlide.html
HTH
Henrique
Can't find what you're looking for? Ask the community or share your knowledge.