hosneyalaa Posted March 25, 2020 Posted March 25, 2020 (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 STATION._REV_2010dwg.dwg Edited March 28, 2020 by CADTutor Reduced text size Quote
hanhphuc Posted March 26, 2020 Posted March 26, 2020 (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 March 28, 2020 by hanhphuc 1 Quote
hosneyalaa Posted March 26, 2020 Author Posted March 26, 2020 (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 STATION P_ARC ._REV_2010dwg.dwg Edited March 28, 2020 by CADTutor Removed unnecessary formatting Quote
Recommended Posts
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.