Registered forum members do not see this ad.
I think I can surprise many people with this final task I am willing to develop somehow...
I want to Make a lisp to allow me to select an entire detail or plan view... then this lisp must split the selection for 3 different object type groups: Dimensions & leaders, text (and if possible mtext), and blocks...
And then the lisp will aply 1 command or lisp to each one of those 3 selection groups...
This is to standarize a Detail or plan according to our standard text, dimension and block sizes... I will try to take care of this part...
But I dont know how to split the selection into 3 selection sets...
Any help will be appreciated..
Then, How can I add 3 different selection groups with a specified assigned abbreviation, and run a specified command or function to each selection group at once?... I tried to just write something but I guess I gotta keep reading..Code:;text & leader delete ;only selects text, mtext & leaders to erase ;created: alan thompson - 4.17.08 (defun c:TX (/ ss) (prompt "\nSelect text & leaders to erase: ") (setq ss (ssget '((0 . "TEXT,MTEXT,LEADER")))) (if ss (progn (command "erase" ss "" ) (princ (strcat "\n " (rtos (sslength ss)) " Text and/or Leader objects have been deleted.")) );progn (princ "\nNo text selected, try again.") );if (princ) )
Code:;Detail updater to current scale ;tried to be written: Paulo Gil .. today (defun c:UD (/ ss ss2 ss3) (prompt "\nSelect a whole detail to update: ") (setq ss (ssget '((0 . "TEXT,MTEXT")))) (setq ss2 (ssget '((0 . "INSERT")))) (setq ss3 (ssget '((0 . "DIMENSION,LEADER")))) (if ss (progn (command "_.chprop" ss "color" "blue" "") );progn (princ "\nNothing selected, try again.") );if (if ss2 (progn (command "_.chprop" ss2 "layer" "Patt" "") );progn (princ "\nNothing selected, try again.") );if (if ss3 (progn (command "_.chprop" ss3 "layer" "Dims" "") );progn (princ "\nNothing selected, try again.") );if (princ) )
Last edited by gilsoto13; 20th Oct 2009 at 06:31 pm.
Just make one large selection set, then iterate through the list using cond and if it "MTEXT" matches (cdr (assoc 0 (entget e)))), then change the color.
BTW, I obviously don't mind you using my code, but please remove my name from anything that I did not write.
Code:;Detail updater to current scale ;created: alan thompson - 4.17.08 (defun c:UD (/ ss ss2 ss3)
Give this a try, untested and in vla, because I'm lazy...
Code:(defun c:UD (/ #SS) (vl-load-com) (cond ((setq #SS (ssget ":L" '((0 . "MTEXT,TEXT,INSERT,DIMENSION,LEADER")))) (vlax-for x (setq #SS (vla-get-activeselectionset (vla-get-activedocument (vlax-get-acad-object))) ) ;_ setq (cond ;; text, mtext ((vl-position (vla-get-objectname x) (list "AcDbMText" "AcDbText")) (vla-put-color x 5)) ;; blocks ((eq (vla-get-objectname x) "AcDbBlockReference") (vl-catch-all-apply 'vla-put-layer (list x "Patt")) ) ;; dimension, leader ((wcmatch (vla-get-objectname x) "*Leader*,*Dimension*") (vl-catch-all-apply 'vla-put-layer (list x "Dims")) ) ) ;_ cond ) ;_ vlax-for (vl-catch-all-apply 'vla-delete (list #SS)) ) ) ;_ cond ) ;_ defun
Do you think it would be easer to window the objects the list the windows corner points
The jus pass it to the 3 ssget functions?
I haven´t checked it out either... but I guess this is what I wanted, the correct order for three different selection sets and only one lisp... Now I guess I can use the
(vl-cmdf "_.any command")
on these "lists"
I actually want to use this new lisp for 2 different purposes... one is for a "Detail scale updater"... and the other will be the "mask all"
So, in the "Detail Scale updater" when you select a bunch of objects the lisp will apply
1 lisp function to filtered blocks...
1 lisp function to Text, Mtext
1 command (Dim--Update) to Dimensions and leaders
The "mask all" will apply
1 Command to Dtext (textmask)
1 lisp function to Mtext (yours, jejeje)
1 lisp or vlx to Dimensions
This is what I am trying to do... but there's no hurry for this... i'll try to go step by step.
I am still working hard everyday to finish the blocks collection.. I finished extracting all collections... The next step is just merging all the blocks into their respective dwgs for compilation.
I am using a Batch dxf to dwg successfully, and I will try a batch PDF to DWG today afternoon for some construction details that were available only in pdf format.
(vl-catch-all-apply 'vla-put-layer (list x "Patt"))
nice one!.but how can i apply those lisp in my autocad!..i dont know how to put it.i mean the codes..where can i put it!..help me guys..im just a newbies in field of autocad and i hope i can learn a lot from!..thanks and god bless!
Registered forum members do not see this ad.