Hi guys,
Could someone tell me, if it's possible (with a lisp code) to change Dot and Dashed linetype to Hidden?
Thanks,
|
Hi guys,
Could someone tell me, if it's possible (with a lisp code) to change Dot and Dashed linetype to Hidden?
Thanks,
Do you want to change the linetype of layers or of entities or of both?
R.K. McSwain | CAD Panacea |
Well here's a quick, crude stab at what a routine may look like.
There's probably a better way, but it's a start.Code:(defun c:hidlt () (command "-layer" "ltype" "hidden" "test" "") ;; changes the linetype to hidden on "test" layer (command "_chprop" "all" "" "ltype" "bylayer" "") ;;changes all entites' linetype to ByLayer (princ) )
Good luck...
Last edited by tedg; 2008-07-14 at 07:46 PM. Reason: Fixed CODE TAGS, accidently re posted (doh)
Ok. I dont want to change entities to Bylayer, only change all entities of drawing to specific Layer and keep linetypes. Only Dot and Dashed must change to Hidden.
Thanks.
Hi,
Try this:
Code:(vl_load_com) (vlax-for blk (vla-get-Blocks (vla-get-ActiveDocument (vlax-get-acad-object)) ) (vlax-for obj blk (if (and (vlax-property-available-p obj 'LineType T) (member (vla-get-Linetype obj) '("DOT" "DASHED")) ) (vla-put-lineType obj "HIDDEN") ) ) )
Last edited by 'gile'; 2008-07-16 at 12:20 AM. Reason: added (vl_load-com)
Thanks for your help!
But it returns error:
"no function definition: VLAX-GET-ACAD-OBJECT; error: An
error has occurred inside the *error* functionAutoCAD variable setting
rejected: "blipmode" nil"
Sorry,
You got this message because I forgot to add a (vl-load-com) at the begining.no function definition: VLAX-GET-ACAD-OBJECT
This expression is needed to load the vlax functions. You can add it to your startup suite so that the vlax functions should be automaticaly loaded.
This message means that the *error* function haven't be reset to the built in one in another routine which redefine it (restting blipmode sysvar).; error: An
error has occurred inside the *error* functionAutoCAD variable setting
rejected: "blipmode" nil