pmadhwal7 Posted August 3, 2019 Posted August 3, 2019 need a lisp to put align dimension refer attachment Quote
BIGAL Posted August 4, 2019 Posted August 4, 2019 Did you ask similar over at Autodesk forums ? I thought it was solved. This is known as a Peg and shift report, take 2 alignments and compare. Quote
Ish Posted August 4, 2019 Posted August 4, 2019 DRAW XLINE PERPENDICULAR THAN EXTRIM FROM BOTH SIDE GREEN AND CENTER LINE. REMAIN PART OF XLINE, YOU CAN USE AUTOMATIC DIMENSION LISP AND SELECT ALL REMAIN PART OF XLINE. YOU WILL GET DIMENSION. Quote
BIGAL Posted August 5, 2019 Posted August 5, 2019 Lsh and pmadhwal7 check the request at Forums.autodesk there is a solution there. https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-in-lisp-to-get-e-n-coordinates-added-to-ch/td-p/8933843 Quote
pmadhwal7 Posted August 5, 2019 Author Posted August 5, 2019 9 hours ago, BIGAL said: Lsh and pmadhwal7 check the request at Forums.autodesk there is a solution there. https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-in-lisp-to-get-e-n-coordinates-added-to-ch/td-p/8933843 not the lisp not helpful i want perpendicular align dimension, Quote
pmadhwal7 Posted August 5, 2019 Author Posted August 5, 2019 On 8/4/2019 at 10:30 AM, Ish said: DRAW XLINE PERPENDICULAR THAN EXTRIM FROM BOTH SIDE GREEN AND CENTER LINE. REMAIN PART OF XLINE, YOU CAN USE AUTOMATIC DIMENSION LISP AND SELECT ALL REMAIN PART OF XLINE. YOU WILL GET DIMENSION. the data i have not straight line it's road line Quote
pmadhwal7 Posted August 6, 2019 Author Posted August 6, 2019 On 8/4/2019 at 7:10 AM, BIGAL said: Did you ask similar over at Autodesk forums ? I thought it was solved. This is known as a Peg and shift report, take 2 alignments and compare. no i didn't ask Quote
BIGAL Posted August 6, 2019 Posted August 6, 2019 The answer is over at the Autodesk forum the alignment of the text, would require the code to be adjusted. Quote
pmadhwal7 Posted August 8, 2019 Author Posted August 8, 2019 On 8/6/2019 at 4:21 PM, BIGAL said: The answer is over at the Autodesk forum the alignment of the text, would require the code to be adjusted. NOT FOUND Quote
myloveflyer Posted August 10, 2019 Posted August 10, 2019 ;;;https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-in-lisp-to-get-e-n-coordinates-added-to-ch/td-p/8933843 ;;;Author dbhunia (defun c:Chin (/ s p c a d tp sch) (setvar "cmdecho" 0) (setq sch (getstring "\nSpecify start chainage : <0>")) ;"0" is set as the default value (if (= sch "")(setq sch "0")) (if (and (setq s (car (entsel "\nPick a polyline :"))) (or (= (cdr (assoc 0 (entget s))) "LWPOLYLINE") (alert "Invalid object! Please pick a polyline only.") ) ) (while (and (setq p (getpoint "\nSpecify point perpendicular to polyline :") ) (setq c (vlax-curve-getclosestpointto s p)) (setq a (angle p c)) (not (grdraw p c 1 -1)) ;; rubber line in red colour. (setq d (angle '(0. 0. 0.) (vlax-curve-getfirstderiv s (vlax-curve-getparamatpoint s c) ) ) ) (or (or (equal (rem (+ d (* pi 0.5)) (+ pi pi)) a 1e-4) (equal (rem (+ d (* pi 1.5)) (+ pi pi)) a 1e-4) ) (alert "Picked point is not a perpendicular to picked polyline. <!>" ) ) (setq tp (getpoint "\nSpecify Point for Text : ")) ) (command "_.QLEADER" p tp "" 1 (strcat "CH=" sch "+" (rtos (vlax-curve-getdistatpoint s c) 2 3)) (strcat "E=" (rtos (car p) 2 3)) (strcat "N=" (rtos (cadr p) 2 3)) "" ) (vlax-put-property (vlax-ename->vla-object (entlast)) 'height 0.6);;; Text Height 0.6 ) ) (setvar "cmdecho" 1) (princ) ) (vl-load-com) Quote
BIGAL Posted August 10, 2019 Posted August 10, 2019 Thanks myloveflyer. The automated version of this would do say all vertice points or at fixed chainages. Again peg and shift report. Quote
pmadhwal7 Posted August 10, 2019 Author Posted August 10, 2019 1 hour ago, BIGAL said: Thanks myloveflyer. The automated version of this would do say all vertice points or at fixed chainages. Again peg and shift report. fixed points like i attached the image Quote
pmadhwal7 Posted August 10, 2019 Author Posted August 10, 2019 3 hours ago, myloveflyer said: ;;;https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-in-lisp-to-get-e-n-coordinates-added-to-ch/td-p/8933843 ;;;Author dbhunia (defun c:Chin (/ s p c a d tp sch) (setvar "cmdecho" 0) (setq sch (getstring "\nSpecify start chainage : <0>")) ;"0" is set as the default value (if (= sch "")(setq sch "0")) (if (and (setq s (car (entsel "\nPick a polyline :"))) (or (= (cdr (assoc 0 (entget s))) "LWPOLYLINE") (alert "Invalid object! Please pick a polyline only.") ) ) (while (and (setq p (getpoint "\nSpecify point perpendicular to polyline :") ) (setq c (vlax-curve-getclosestpointto s p)) (setq a (angle p c)) (not (grdraw p c 1 -1)) ;; rubber line in red colour. (setq d (angle '(0. 0. 0.) (vlax-curve-getfirstderiv s (vlax-curve-getparamatpoint s c) ) ) ) (or (or (equal (rem (+ d (* pi 0.5)) (+ pi pi)) a 1e-4) (equal (rem (+ d (* pi 1.5)) (+ pi pi)) a 1e-4) ) (alert "Picked point is not a perpendicular to picked polyline. <!>" ) ) (setq tp (getpoint "\nSpecify Point for Text : ")) ) (command "_.QLEADER" p tp "" 1 (strcat "CH=" sch "+" (rtos (vlax-curve-getdistatpoint s c) 2 3)) (strcat "E=" (rtos (car p) 2 3)) (strcat "N=" (rtos (cadr p) 2 3)) "" ) (vlax-put-property (vlax-ename->vla-object (entlast)) 'height 0.6);;; Text Height 0.6 ) ) (setvar "cmdecho" 1) (princ) ) (vl-load-com) din't needed like this check the below link for more Quote
BIGAL Posted August 10, 2019 Posted August 10, 2019 You can use VL getclosestpointto so just pick all he Leaders ? get end point and compare to road pline. Just need to confirm it is a "leader" ? What layer for dims and style name. Quote
pmadhwal7 Posted August 10, 2019 Author Posted August 10, 2019 17 minutes ago, BIGAL said: You can use VL getclosestpointto so just pick all he Leaders ? get end point and compare to road pline. Just need to confirm it is a "leader" ? What layer for dims and style name. yes sir it's leader Quote
BIGAL Posted August 10, 2019 Posted August 10, 2019 Have a look at this no error checking and you need to set current dimstyle ; peg shift routine ; By AlanH Consulting Aug 2019 (alert "pick leaders when asked for selection") (defun c:pegshift ( / ss obj obj2 obj3 co-ords pt1 pt2) (setq ss (ssget (list (cons 0 "leader")))) (setq obj (vlax-ename->vla-object (car (entsel "Pick pline")))) (repeat (setq x (sslength ss)) (setq obj2 (vlax-ename->vla-object (ssname ss (setq x (- x 1))))) (setq co-ords (vlax-safearray->list (vlax-variant-value (vlax-get-property obj2 "Coordinates" ) ) ) ) (setq pt1 (list (nth 0 co-ords)(nth 1 co-ords))) (setq pt2 (vlax-curve-getclosestpointto obj pt1)) (command "dim" "_al" pt1 pt2 pt1 "" "exit") (setq obj3 (vlax-ename->vla-object (entlast))) (vla-put-ExtLine2Suppress obj3 -1) (vla-put-ExtLine1Suppress obj3 -1) ) ) (c:pegshift) Quote
pmadhwal7 Posted August 10, 2019 Author Posted August 10, 2019 1 hour ago, BIGAL said: Have a look at this no error checking and you need to set current dimstyle ; peg shift routine ; By AlanH Consulting Aug 2019 (alert "pick leaders when asked for selection") (defun c:pegshift ( / ss obj obj2 obj3 co-ords pt1 pt2) (setq ss (ssget (list (cons 0 "leader")))) (setq obj (vlax-ename->vla-object (car (entsel "Pick pline")))) (repeat (setq x (sslength ss)) (setq obj2 (vlax-ename->vla-object (ssname ss (setq x (- x 1))))) (setq co-ords (vlax-safearray->list (vlax-variant-value (vlax-get-property obj2 "Coordinates" ) ) ) ) (setq pt1 (list (nth 0 co-ords)(nth 1 co-ords))) (setq pt2 (vlax-curve-getclosestpointto obj pt1)) (command "dim" "_al" pt1 pt2 pt1 "" "exit") (setq obj3 (vlax-ename->vla-object (entlast))) (vla-put-ExtLine2Suppress obj3 -1) (vla-put-ExtLine1Suppress obj3 -1) ) ) (c:pegshift) it was asking for select object when i am going to select polyline it was showing 0 object selected.... Quote
Tharwat Posted August 10, 2019 Posted August 10, 2019 (edited) Hi, What is the type of the object in the attached image? Dimension or Leader or Mleader? Can you upload sample drawing? Edited August 10, 2019 by Tharwat Quote
BIGAL Posted August 10, 2019 Posted August 10, 2019 The leaders are picked by the selection just window/pick which ones, you need then to pick the road alignment pline. You must set correct dimstyle to use as well. change (entsel "Pick pline") To (entsel "Pick road pline") Quote
pmadhwal7 Posted August 12, 2019 Author Posted August 12, 2019 On 8/10/2019 at 4:10 PM, Tharwat said: Hi, What is the type of the object in the attached image? Dimension or Leader or Mleader? Can you upload sample drawing? check the attachment sample.dwg 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.