Jump to content
danyra

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

Recommended Posts

danyra

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

Share this post


Link to post
Share on other sites
ronjonp

Why don't you use an attributed block?

Share this post


Link to post
Share on other sites
danyra
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

Share this post


Link to post
Share on other sites
ronjonp
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

Share this post


Link to post
Share on other sites
Jaru

Hey man

maybe this routine works for you, it's from LeeMac so his credits are his,

It is also valid for lines, polylines and blocks.

AlignTextToCurveV1-2.lsp

Share this post


Link to post
Share on other sites
danyra
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.  :)

Share this post


Link to post
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
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

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