Jump to content

Label Polyline Segments at middle


S_ARELLANO

Recommended Posts

Hi everyone, today i would  to ask for your help with a way to label a group of selected Polyline/Lines at the middle of each segment in the case of the polylines or at the middle of the line.

 

I pretty much have the basic idea of how to make the LISP but, being honest, i don't have any idea of how to write the code needed. Basically, the steps i do when labeling manually my PLines is:

 

First, i choose my custom text style named SS_BSligth, then i select middle bottom justification and select the middle point of the PLine segment i'm working with, then i write the heigth of the text by multypling 2.5 times the scale i'm working with and dividng by a thousand (i.e. if i'm working on a 1:100 scale, i use a text height of 2.5 x 100 / 1000 = 0.25 pts.),  then i write down the length of my line and some other parameters that i fill up later on, using a format of 20.00-X.XX-20 where, 20.00 is the length of the segment and -X.XX-20 are the values that i fill up later. 

 

After having all of this, i proceed to move the text i just created upwards by a certain amount of points based on the polyline width (i.e. if the PLine width is 0.75 i move the text upwards by 0.60/2+0.10 = 0.40), then i rotate the text with the base point at the middle of the segment line, and then i rotate the text so it aligns to the segment of the PLine.

 

IDK if this is actually possible, i guess it is but i don't really have any idea of LISP to make it bymyself, that's why i'm writing this thread looking for help of you guys.

 

PS. I'm adding an image for reference, as well as the sample DWG. Also, i think it's convenient to say that i work with Mertical Units.

 

Many thanks in advance. Cheers

 

 

image.png

sample.dwg

Edited by S_ARELLANO
Link to comment
Share on other sites

(defun c:lapel ( / p1 p2)
  (while (and
	   (or p1 (setq p1 (getpoint "\nStart Point")))
	   (setq p2 (getpoint p1 "\nNext Point"))
	   )

    (......)
    )
  (princ)
  )

 

put lapel in teh midble of segmnet yes? 

 

39663097_lapelshow.png.0bfccbb2154a271876f4588f4953c5c6.png

 

f8rgiv3 my dyslexia...

Edited by pBe
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...