Jump to content

How can I make the autolisp place a text on a line that is already made by the autolisp?


danyra

Recommended Posts

Im beginner, I have this:

 

(setq p1 (getpoint "\nPunto Inicial:"))
      (setq p2 (polar p1 (* 1.5 pi) 0.5))
       (entmakex (list '(0 . "line") (cons 10 p1) (cons 11 p2) '(62 . 2)))

 

So, the line I drawn is the yellow one below in the image. And, the text I want put is the magenta one.

how can I do this? 

Thanks for your help

 

 

imagen.jpg

Link to comment
Share on other sites

10 minutes ago, ronjonp said:

Why don't you use an attributed block?

how i can do this? sorry as I said Im a beginner 

I will glad for your help

Link to comment
Share on other sites

3 minutes ago, danyra said:

how i can do this? sorry as I said Im a beginner 

I will glad for your help

Like attached:

 

example.dwg

 

Here is code to place that text although it's not how I'd approach it.

(setq p1 (getpoint "\nPunto Inicial:"))
(setq p2 (polar p1 (* 1.5 pi) 0.5))
(entmakex (list '(0 . "line") (cons 10 p1) (cons 11 p2) '(62 . 2)))
(entmakex (list	'(0 . "TEXT")
		'(100 . "AcDbEntity")
		'(8 . "YourTextLayer")
		'(100 . "AcDbText")
		(cons 10 (mapcar '+ p1 '(0.17 0.29 0.)))
		'(40 . 0.1)
		'(1 . "%%UVIGA V-SS01 (.25X.50)")
		'(50 . 0.)
		'(41 . 1.)
		'(51 . 0.)
		'(11 0. 0. 0.)
	  )
)

 

Edited by ronjonp
  • Thanks 1
Link to comment
Share on other sites

On 12/3/2019 at 2:13 PM, ronjonp said:

(entmakex (list '(0 . "TEXT") '(100 . "AcDbEntity") '(8 . "YourTextLayer") '(100 . "AcDbText") (cons 10 (mapcar '+ p1 '(0.17 0.29 0.))) '(40 . 0.1) '(1 . "%%UVIGA V-SS01 (.25X.50)") '(50 . 0.) '(41 . 1.) '(51 . 0.) '(11 0. 0. 0.) ) )

thanks you for your help,  its works.  :)

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