Jump to content

Assigning value from a variable to a block name


svorgodne

Recommended Posts

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

Link to comment
Share on other sites

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

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