Jump to content

Recommended Posts

Posted

This solution work form me, but maybe I'm missing something?

(vlax-for #item (vla-get-LineTypes (vla-get-ActiveDocument (vlax-get-acad-object)))
    (if (and
            (not (wcmatch (strcase (vla-get-name #item)) "BYBLOCK,BYLAYER"))
            (= (logand (cdr (assoc 70 (entget (vlax-vla-object->ename #item)))) 16) 0)
        )
        (setq line_types_in_drawing (cons (strcase (vla-get-name #item)) line_types_in_drawing))
    )
)

 

Posted

You could iterate with vanilla, without having to reconvert every definition:

(while (setq d (tblnext "LTYPE" (not d)))
  (if (= 0 (logand (cdr (assoc 70 d)) 16))
    (setq L (cons (cdr (assoc 2 d)) L))
  )
)
(= (length L) (length line_types_in_drawing)) >> T

 

Posted

Another?

(vlax-for #item (vla-get-LineTypes (vla-get-ActiveDocument (vlax-get-acad-object)))
    (if (and
            (snvalid (setq n (strcase (vla-get-name #item))))
            (not (wcmatch n "BYBLOCK,BYLAYER"))
        )
        (setq L (cons n L))
    )
)

 

Posted

The snavalid test is redundant - if the linetype already exists, the name must be valid.

Posted (edited)
39 minutes ago, Lee Mac said:

The snavalid test is redundant - if the linetype already exists, the name must be valid.

The snvalid function is used to check for xref-dependent linetypes.

(defun test ( / lst)
  (vlax-for obj (vla-get-linetypes (vla-get-activedocument (vlax-get-acad-object)))
    (if (not (wcmatch (strcase (vla-get-name obj)) "*|*,BYBLOCK,BYLAYER"))
      (setq lst (cons (vla-get-name obj) lst))
    )
  )
  (reverse lst)
)

 

Edited by Roy_043

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...