jan_ek Posted March 24, 2012 Posted March 24, 2012 Hello. I have a question. How do I get the value of points indicated by Lisp. http://www.fotosik.pl/pokaz_obrazek/d10bcfe75613bb78.html Quote
MSasu Posted March 24, 2012 Posted March 24, 2012 You should check the DXF code 10 that store one of the points that you are looking for; the second one may be calculated using the said point. Second, please post you picture here instead of that site. Regards, Mircea Quote
pBe Posted March 24, 2012 Posted March 24, 2012 (defun AT:GetVertices (e / p l) ;; Return point at each vertex of curve ;; e - curve to evaluate (Arc, Line, *Polyline, Spline) ;; [b]Alan J. Thompson,[/b] 09.30.10 (if e (if (eq (setq p (vlax-curve-getEndParam e)) (fix p)) (repeat (setq p (1+ (fix p))) (setq l (cons (vlax-curve-getPointAtParam e (setq p (1- p))) l)) ) (list (vlax-curve-getStartPoint e) (vlax-curve-getEndPoint e)) ) ) ) kudos to Alanjt Quote
Tharwat Posted March 24, 2012 Posted March 24, 2012 (defun c:TesT (/ ent e ) (if (and (setq ent (car (entsel "\n Select a dim :"))) (eq (cdr (assoc 0 (setq e (entget ent)))) "DIMENSION") ) (progn (princ (cdr (assoc 13 e))) (princ (cdr (assoc 14 e))) ) (princ) ) (princ) ) Quote
jan_ek Posted March 24, 2012 Author Posted March 24, 2012 Thanks for your help. msasu - Second, please post you picture here instead of that site. - Sorry, and thank you for "DXF 10"pBe - This is very cool and will definitely be using it once, but this dimension can not be used Tharwat - I stayed here in this place. I am trying to calculate the coordinates using the "DXF 10". Quote
Tharwat Posted March 24, 2012 Posted March 24, 2012 Tharwat - I stayed here in this place. I am trying to calculate the coordinates using the "DXF 10". can you please explain your aim more specifically ? Quote
MSasu Posted March 24, 2012 Posted March 24, 2012 From the picture seems that OP is looking for the ends of the dimension line; the codes 13 and 14 stores the application points of extension lines. For sure, those can be coincident with the points the OP is looking for, but this is just an exception. To calculate the second point jan_ek should start from the coordinates of point stored under DXF code 10 and check the type of dimension, his orientation and, if case the points under codes 13 and 14. Regards, Mircea Quote
Tharwat Posted March 24, 2012 Posted March 24, 2012 >> Apoligies guys..... I'm so retarded When I saw the code you provided without paying attention to dimension , that made me to read the first post form many times before posting my first one . Quote
pBe Posted March 24, 2012 Posted March 24, 2012 From the picture seems that OP is looking for the ends of the dimension line; Regards, Mircea Isnt it just 10 and polar 10 (angle 10 11) (* (distance 10 11) 2.0) ? Quote
jan_ek Posted March 24, 2012 Author Posted March 24, 2012 It's about the exact point indicated in the picture, or not "13,14".I have another question. Is it possible to read the scales indicated dimension? Quote
MSasu Posted March 24, 2012 Posted March 24, 2012 (edited) @pBe: I'm afraid not, this will be true only when the label is on middle and centered on vertical. What about the cases when the label is aligned to one of the extension lines and/or is located above dimension line or was simply moved by user in a totaly arbitrary location? Regards, Mircea Edited March 24, 2012 by MSasu Clarification on recipient (shifted posts) Quote
MSasu Posted March 24, 2012 Posted March 24, 2012 Is it possible to read the scales indicated dimension? Dimensions features are controled by DIMSCALE system variable. If is about the value of linear dimensions check DIMLFAC. Regards, Mircea Quote
pBe Posted March 24, 2012 Posted March 24, 2012 (defun c:pointd (/ _dxf _list ss ent) (setq _dxf (lambda (dx en) (cdr (assoc dx (entget en))))) (setq _list (lambda (p1 p2) (polar p1 (angle p1 p2) (* (distance p1 p2) 2)))) (setq ss (ssget '((0 . "DIMENSION")))) (repeat (sslength ss) (setq ent (ssname ss 0)) (print (list (_dxf 10 ent) (_list (_dxf 10 ent) (_dxf 11 ent))) ) ) (princ) ) Quote
MSasu Posted March 24, 2012 Posted March 24, 2012 Nice approach, but please check post 12. Regards, Mircea Quote
pBe Posted March 24, 2012 Posted March 24, 2012 Nice approach, but please check post 12. Regards, Mircea Oh, i didnt see that post... i guess you're right.. anyhooo. i'll try again tommorow, GTG Cheers Quote
jan_ek Posted March 24, 2012 Author Posted March 24, 2012 I do not understand how this code works.Here I combines with the "sin cos tan cot '" and here a nice and clean. But for me this code is not working properly.The first point shows ok, but the second is far from the dimension Quote
MSasu Posted March 24, 2012 Posted March 24, 2012 The solution pBe posted works well for DIMTAD = 0 and DIMJUST = 0. Regards, Mircea Quote
pBe Posted March 24, 2012 Posted March 24, 2012 The solution pBe posted works well for DIMTAD = 0 and DIMJUST = 0. Regards, Mircea As I was riding the bus. i kept thinking about this post.. its driving me nuts... . so as soon as i got home, i wrote this (defun c:pointd (/ _dxf ss en ent pts) (setq _dxf (lambda (dx en) (cdr (assoc dx (if (listp en) en (entget en)))))) (if (setq ss (ssget "_:S:E" '((0 . "DIMENSION")))) (progn (setq en (ssname ss 0)) (setq ent (tblobjname "BLOCK" (_dxf 2 en))) (repeat 3 (setq ent (entnext ent))) (setq pts (list (_dxf 10 (setq ln (entget ent))) (_dxf 11 ln))) ) ) pts ) . also i used Architectural tick for arrows, same as the posted picture, which makes it easier to code Cheers Mircea... Off to sleep Quote
marko_ribar Posted March 24, 2012 Posted March 24, 2012 (edited) But your first code was OK... Only missed distance (_dxf 42 ent) and also (_dxf 13 ent) and (_dxf 14 ent) are involved... (defun c:pointd (/ _dxf _list ss ent li) (setq _dxf (lambda (dx en) (cdr (assoc dx (entget en))))) (setq _list (lambda (p1 p2 p3) (polar p1 (angle p2 p3) (_dxf 42 ent)))) (setq ss (ssget "_+.:E:S" '((0 . "DIMENSION")))) (if (equal (assoc 100 (reverse (entget (setq ent (ssname ss 0))))) (cons 100 "AcDbAlignedDimension")) (progn (setq li (entmakex (list '(0 . "LINE") (cons 10 (_dxf 10 ent)) (cons 11 (_list (_dxf 10 ent) (_dxf 14 ent) (_dxf 13 ent))) '(62 . 1)))) (print (list (_dxf 10 li) (_dxf 11 li))) (entdel li) ) (prompt "\nWrong type of dimension picked - you must pick Aligned dimension") ) (princ) ) M.R. Edited March 25, 2012 by marko_ribar code changed 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.