View Full Version : Dashed and Dot to Hidden
pt_zooropa
2008-07-14, 06:38 PM
Hi guys,
Could someone tell me, if it's possible (with a lisp code) to change Dot and Dashed linetype to Hidden?
Thanks,
rkmcswain
2008-07-14, 07:40 PM
Do you want to change the linetype of layers or of entities or of both?
pt_zooropa
2008-07-14, 08:42 PM
Do you want to change the linetype of layers or of entities or of both?
Some drawings have layers with other linetypes and have objects too. I think the best solution would be to change the layers, or the objects, so that there would be just the sort of hidden linetype.
Some drawings have layers with other linetypes and have objects too. I think the best solution would be to change the layers, or the objects, so that there would be just the sort of hidden linetype.
Well here's a quick, crude stab at what a routine may look like.
(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)
)
There's probably a better way, but it's a start.
Good luck...
pt_zooropa
2008-07-15, 12:40 PM
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.
'gile'
2008-07-15, 01:03 PM
Hi,
Try this:
(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")
)
)
)
pt_zooropa
2008-07-16, 01:36 AM
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"
'gile'
2008-07-16, 02:21 AM
Sorry,
no function definition: VLAX-GET-ACAD-OBJECT
You got this message because I forgot to add a (vl-load-com) at the begining.
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.
; error: An
error has occurred inside the *error* functionAutoCAD variable setting
rejected: "blipmode" nil
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).
vBulletin® v3.6.7, Copyright ©2000-2009, Jelsoft Enterprises Ltd.