Jump to content

regarding display attribute values in drawing through lisp


Recommended Posts

Posted

hi everybody,

i want 2 capture the attribute values of the point and display it in the drawing by using autolisp.

by using entget we can get the information about the entity, by using which command we can able 2 retrieve the attribute data.

 

in the entmake command,

entmake '(( 0 . "text")(40 . 0.2)(nth count plist)(1 . "missing") ---- by giving like this means its working fine. but in this i want 2 use variable which has capture the data while running.

for ex

(setq trs(cdr(assoc -1 ent) ----- entity name

now i want 2 use the variable in entmake.

i had used as

(entmake '((0 . "text")(40 . 0.2)(nth coutn plist)(1. trs) ------ its showing error. bad dxf code.

can anyone gave me help to solve the problem.

 

 

regards

m.arunachalam

Posted

I abswered your question at the 'other' forum also...

 

You are using the variable 'trs' to supply a string value and combine it into a data pair. You *can*use only literal values in a quoted list, as variables will not be evaluated. When including variables in a list, use the "list" function rather than a quote (apostrophe). Also, to create a "dotted pair" list (two values separated by a period), use the "cons" function.

 

So you should use;

 

(entmake 
  (list
     (0 . "text")
     (40 . 0.2)
     (nth count plist);;<<-??Is this a data pair?
     (cons 1 trs))
  )
)

  • 2 years later...
Posted

How can I convert 3d to 2d, I mean z=0

Posted
How can I convert 3d to 2d, I mean z=0

you can convert a point like this:

((lambda (x) (list (car x) (cadr x))) (getpoint))

or just

(setq point1 (getpoint)
       point1z (list (car point1) (cadr point1))
)

Posted
How can I convert 3d to 2d, I mean z=0

 

If you have a new unrelated question - please start a new thread.

 

This helps with searches and will get your question answered both quicker and more accurately.

Posted
If you have a new unrelated question - please start a new thread.

 

This helps with searches and will get your question answered both quicker and more accurately.

oh yeah, oops.

what lee said ^

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