Spinxy Posted August 4, 2011 Posted August 4, 2011 Hey, I'm trying to make some scripts that will automatically find certain elements from a qselect and change their layers and properties. i'm trying ssx command which finds the elements but don't keep them selected, i'm also struggling with a command to change the layers, and set colour, linetype and lineweight to bylayer i have lots of these to make which will all be pretty similar to automate track design outputs into our cad standard format. i want to find everything on layer T-PROF-GRID and change to G_misc25, color to BYLAYER, Lintype to BYLAYER, Lineweight to BYLAYER. also i want to find every polyline on T-PROF-TEXT and change to G_misc, color to BYLAYER, Lintype to BYLAYER, Lineweight to BYLAYER. if i have help creating these i'm pretty sure i would figure out how to do the rest! Quote
MSasu Posted August 4, 2011 Posted August 4, 2011 Since seems that you are using AutoCAD full, you can solve that by AutoLISP: (setq ItemsSet (ssget "_X" '((8 . "T-PROF-GRID")))) (if ItemsSet (command "_CHPROP" ItemsSet "" "_LA" "G_misc25" "_C" "_ByLayer" "_LT" "_ByLayer" "_LW" "_ByLayer" "")) (setq ItemsSet (ssget "_X" '((0 . "LWPOLYLINE") (8 . "T-PROF-TEXT")))) (if ItemsSet (command "_CHPROP" ItemsSet "" "_LA" "G_misc" "_C" "_ByLayer" "_LT" "_ByLayer" "_LW" "_ByLayer" "")) Regards, Mircea Quote
Spinxy Posted August 4, 2011 Author Posted August 4, 2011 Sorry real basic question, i haven't run lisp for a while, how do i run this? Quote
MSasu Posted August 4, 2011 Posted August 4, 2011 There used to be a FAQ page on this subject - but I'm not able to locate it now. Please check this tutorial from LeeMac. Regards, Mircea Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.