Jump to content

getting error for lisp


reda

Recommended Posts

hi everyone,

i try to print dimstyle for currently open at the command line.its getting error.

kinldy solve anyone.

thanks advance

(defun c:19 ()
  
  (vl-load-com)
  
  (setq adoc (vla-get-activedocument(vlax-get-acad-object)))
  
  (setq tx_style (vla-get-DimStyles adoc))
  
  (setq tx_style_list '())
    
  (vlax-for item tx_style          
    (setq dwg_style_list (vlax-get-property item 'DimStyles ))
     (setq tx_style_list (append (list dwg_style_list )tx_style_list))
  
  )
(princ tx_style_list)
(princ)


)

 

Link to comment
Share on other sites

Will this do the same?

 

Quote
(defun tablesearch ( s / d r) ;;List Dimstyles
  (while (setq d (tblnext s (null d)))
    (setq r (cons (cdr (assoc 2 d)) r))
  )
)

(princ (tableSearch "dimstyle"))

 

 

Link to comment
Share on other sites

(adding to this, it helps if you tell us what error it is showing by the way, don't always have CAD running to tell me you see)

Link to comment
Share on other sites

13 hours ago, Steven P said:

Will this do the same?

 

 

hi,

thanks for your reply.it works .i want to know if my code only getting error messages at the command line.

Link to comment
Share on other sites

4 hours ago, reda said:

hi,

thanks for your reply.it works .i want to know if my code only getting error messages at the command line.

 

what is the error message by the way?

 

 

 

your problem is on this line I think:

(setq dwg_style_list (vlax-get-property item 'DimStyles ))

 

Edited by Steven P
Link to comment
Share on other sites

Had 10 minutes to think about this one,

 

Commented out the line that is causing you a problem and putting in an alternative above it

 

(defun c:19 ()
  (vl-load-com)
  (setq adoc (vla-get-activedocument(vlax-get-acad-object)))
  (setq tx_style (vla-get-DimStyles adoc))
  (setq tx_style_list '())
  (vlax-for item tx_style   
    (setq dwg_style_list (vla-get-Name item) )
;    (setq dwg_style_list (vlax-get-property item 'DimStyles ))
     (setq tx_style_list (append (list dwg_style_list )tx_style_list))
  )
  (princ tx_style_list)
  (princ)
)

 

Link to comment
Share on other sites

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