reda Posted March 6, 2023 Share Posted March 6, 2023 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) ) Quote Link to comment Share on other sites More sharing options...
Steven P Posted March 6, 2023 Share Posted March 6, 2023 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")) Quote Link to comment Share on other sites More sharing options...
Steven P Posted March 6, 2023 Share Posted March 6, 2023 (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) Quote Link to comment Share on other sites More sharing options...
reda Posted March 7, 2023 Author Share Posted March 7, 2023 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. Quote Link to comment Share on other sites More sharing options...
Steven P Posted March 7, 2023 Share Posted March 7, 2023 (edited) 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 March 7, 2023 by Steven P Quote Link to comment Share on other sites More sharing options...
Steven P Posted March 7, 2023 Share Posted March 7, 2023 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) ) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.