Jump to content

Select All via Linetype???


Recommended Posts

Posted

I'm writing a custom LISP to grab all entities with a custom LINETYPE and change it to a normal AutoCAD related Linetype. I don't need to use the ENTSEL with a DXF Group Code function because I already know the Linetype name. I think I can just simply use the CHPROP method but it's asking to Select Objects when I use it. I'm just wondering what is the best way for me to use the SETQ function for the Linetype.

 

Hope this makes sense. Thanks in advance for the help. :)

Posted

Hi. Change "DASHED" into custom linetype.

 

(defun c:cln(/ lSet)
 (if(setq lSet(ssget "_X" '((6 . [color="Blue"]"DASHED"[/color]))))
   (progn
     (princ(strcat "\n" (itoa(sslength lSet)) " objects found."))
     (sssetfirst nil lSet)
     (initget "Yes No")
     (if(= "Yes"(getkword "\nChange linetype? [Yes/No]: "))
 (command "_.chprop" lSet "" "_lt" "Continuous" "")
 (sssetfirst nil nil)
); end if
     ); end progn
   ); end if
 (princ)
 ); end of c:cln

Posted

Oh okay, SSGET is what I'm after. I will try it now... ASMI thanks for the code but I was wanting to learn myself... lol. You spoil me, you know this right? :)

Posted
ASMI thanks for the code but I was wanting to learn myself... lol. You spoil me, you know this right?

 

Probably, excuse if it so. But you have many possibilities to write a code by another. Absolutely on another... :)

Posted

Maybe to change from HIDDEN to BYLAYER:

(defun c:rlt (/ ss)
 (and (setq ss (ssget "X" (list (cons 6 "HIDDEN"))))
      (command "_.CHANGE" ss "" "_P" "_LT" "BYLAYER" ""))
(prin1))

-David

Posted

ASMI, David, worked perfectly. Thanks again guys!! ASMI next time teach me instead of writing a code for me, haha.... :wink:

 

I was on the right track, I just forgot about using the SSGET function. I know in the DXF Group Codes that 6 is referred to Linetypes. Quick question David, the code in (cons 6 "HIDDEN") is this '6' still associated with Linetypes such as in the DXF Group Codes? Just wondering is all. Thanks again everyone.

Posted

StykFacE,

 

Yes, 6 is linetypes. The VLisp help is actually a pretty good reference.

 

For a list of all of the numerical codes:

 

DXF Reference Table Of Contents -> DXF Format -> Group Codes In Numerical Order

 

-David

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...