Jump to content

STATION Marking on polyline Based on OLD STATION Marking


Recommended Posts

Posted (edited)
Hello all.....
Sorry for my language
I have a line or POLYLINE 
Written on it  STATION  Marking 
And the length is inconsistent with the station value
if possible
 I want based on the value of the old stations
When I click on a line or POLYLINE  a new station value appears
I found  code TO dlanorh

 

Needs modification of what I want
Please provide us with appropriate ideas and solutions
Who has the time?
Thanks, thanks
Attachment
Pictures of the required
And the working file

 

S1.PNG

S2.PNG

S3.PNG

STATION._REV_2010dwg.dwg

Edited by CADTutor
Reduced text size
Posted (edited)
(defun c:test (/ n p1 p d $)
  (setq os (getvar 'osnapz))
  (setvar 'osnapz 1)
  (initget 1)
  (and (setq n (getreal "\nStart STA : "))
       (setq p1 (getpoint "\nStart pt "))
       (setq $ (getstring (strcat "\nIncrement <Enter> or '-' \n")))
  (while
       (setq p (getpoint p1 "\nNext point "))
       (setq d (distance p1 p))
       (setq d
	      (if (wcmatch $ "-*")
		(- d)
		d
	      )
	     )
    (princ (strcat "\n" (rtos d 2 3) ))
       (entmakex (list '(0 . "TEXT")
		       (cons 1 (_rtosta (+ n d) 3))
		       (cons 40 (getvar 'textsize))
		       (cons 10 (trans p 1 0))
		 )
       )
    )
   (setvar 'osnapz os)
  )
  (princ)
)

 

Edited by hanhphuc
  • Thanks 1
Posted (edited)

HI hanhphuc Thank you

If you have time
I want you to be the distance linked to LENGTH  POLYLINE , Especially if the POLYLINE  contains an arc

(setq e (entsel "\n SELECT POLYLINE ")))

 (setq p1 (getpoint "\nStart pt "))
      (setq D0 (vlax-curve-getdistatpoint e p1); distance AT POINT p1 ON POLYLINE

AND 

(while

 (setq p (getpoint p1 "\nNext point "))

  (setq DW (vlax-curve-getdistatpoint e p1); distance AT POINT p ON POLYLINE
       (setq d (distance DW D0))

 

If possible, modify the code and add this idea

Thank you

 

 

 

P_ARC.PNG

STATION P_ARC ._REV_2010dwg.dwg

Edited by CADTutor
Removed unnecessary formatting

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