svorgodne Posted February 25, 2009 Share Posted February 25, 2009 It's easy to assign a value to a variable (symbol) like this (setq a 2) !a 2 How can I assign that variable name to a block name (command "block" !a ? (print a) (princ a) (list a) (a) I really cannot understand how this extremely easy function has been so difficult for me to find out how to be solved. Please help me with this. Thanks in advance Autocad release 2006 Quote Link to comment Share on other sites More sharing options...
svorgodne Posted February 25, 2009 Author Share Posted February 25, 2009 I was able to solve the problem assigning the value from a variable or a symbol as the name from a block. The problem I have now is how to combine the value from two variables as the name from a block (setq a "sample") (setq b 1) (princ a)(princ b) sample1 This last value is the one I want to assign as a block nmae... so far I have done this: (defun c:sample () (setq a "sample") (setq b 1) (setq c (princ (princ a(princ b)) (command "block" (princ a) ;;this is the part not working so far ) Thanks in advance and still in AutoCAD 2006 Quote Link to comment Share on other sites More sharing options...
CarlB Posted February 25, 2009 Share Posted February 25, 2009 (setq a "sample") (setq b 1) (setq b$ (itoa b));converts integer to a string (setq a_b (strcat a b$));combines strings (command "block" a_b) 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.