Jump to content

Recommended Posts

  • Replies 43
  • Created
  • Last Reply

Top Posters In This Topic

  • MSasu

    14

  • pBe

    10

  • jan_ek

    10

  • Lee Mac

    4

Top Posters In This Topic

Posted Images

Posted

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

Posted

(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 :thumbsup:

Posted
(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)
)

Posted

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

Posted

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 ?

Posted

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

Posted

>> :o

 

Apoligies guys.....

 

I'm so retarded :rofl:

Posted
>> :o

 

Apoligies guys.....

 

I'm so retarded :rofl:

 

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

Posted
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) ?

Posted

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?

Posted (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 by MSasu
Clarification on recipient (shifted posts)
Posted
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

Posted
(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)
     )

Posted
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

Posted

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

Posted

The solution pBe posted works well for DIMTAD = 0 and DIMJUST = 0.

 

Regards,

Mircea

Posted
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... :lol:. 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

Posted (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 by marko_ribar
code changed

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