Jump to content

dimensioning question


ryan osmun

Recommended Posts

ok i got it to work, i did it on a drawing that didnt have any of my settings and it worked, for some reason some setting on the templates i use it will not work with.

 

ok nvm everything i said, the reason it wasnt working is because i have my circles as a block so therefore the reason it was working. i explode them and it worked perfect. sorry for the pain like i said im not the most CAD savvy!

Link to comment
Share on other sites

  • Replies 93
  • Created
  • Last Reply

Top Posters In This Topic

  • ryan osmun

    36

  • ReMark

    31

  • Tharwat

    24

  • RobDraw

    3

Top Posters In This Topic

Posted Images

The dimstyle was standard not annotative. I double checked it by erasing the dimensions and going into dimstyle and resetting "standard" as "current".

Link to comment
Share on other sites

ok i got it to work, i did it on a drawing that didnt have any of my settings and it worked, for some reason some setting on the templates i use it will not work with.

Happy to hear that Ryan .

 

Was it as you expected it ?

Link to comment
Share on other sites

Happy to hear that Ryan .

 

Was it as you expected it ?

 

thats awesome i think it works even better than the one created before!!

 

my next question is how can i select multiple of the circles that i have as blocks to explode them all quick and easy so that i can use this efficiently?

 

figured this out to haha! thank you!!

Link to comment
Share on other sites

thats awesome i think it works even better than the one created before!!

 

That's great .

 

my next question is how can i select multiple of the circles that i have as blocks to explode them all quick and easy so that i can use this efficiently?

 

That's the main headache of the code :(

 

Explode the blocks that are represented as circles and use the code to create the dimensions .

Link to comment
Share on other sites

also if you wanted to touch it up, once you have selected one circle it cannot go back to that circle, if you could make it so that it can go back to ones that have already gone over that would be really good to.

Link to comment
Share on other sites

yes that works, what about dimensioning to the perimeter from the circle, is there any solution that you would have for me? sometimes its a straight line sometimes its like an arched perimeter.

Link to comment
Share on other sites

also if you wanted to touch it up, once you have selected one circle it cannot go back to that circle, if you could make it so that it can go back to ones that have already gone over that would be really good to.

 

Maybe you could try restarting the command.

 

Here is my final modification for this and it could repeat as much as you want .

 

(defun c:CirlesAutoDim
      (/ *error* c go p1 gr e ent dimension p2 lst ang)
 (vl-load-com)
;;;   Tharwat Al Shoufi  12. 10. 2012 ;;;
;;; Create Dimensions between circles ;;;
 (defun *error* (x) (princ "\n *Cancel*") (princ))
 (if (not acdoc)
   (setq acdoc (vla-get-activedocument (vlax-get-acad-object)))
 )
 (setq spc (if (> (vla-get-activespace acdoc) 0)
             (vla-get-modelspace acdoc)
             (vla-get-paperspace acdoc)
           )
 )
 (prompt "\n Select start Circle ...")
 (if (setq c (ssget "_+.:S" '((0 . "CIRCLE"))))
   (progn
     (setq p1 (cdr (assoc 10 (entget (ssname c 0)))))
     (setq go t)
     (setq
       lst (cons (cdr (assoc -1 (entget (ssname c 0)))) lst)
     )
   )
   (princ "\n Nothing selected or not a Circle object ")
 )
 (while (and go (eq 5 (car (setq gr (grread t 15 2)))))
   (redraw)
   (princ
     "\r Move cursor over circles to add dimension entity between them :"
   )
   (if (and (setq e (ssget (cadr gr)))
            (eq (cdr (assoc 0 (setq ent (entget (ssname e 0)))))
                "CIRCLE"
            )
            (not (member (cdr (assoc -1 ent)) lst))
       )
     (progn
       (setq
         dimension (vla-adddimaligned
                     spc
                     (vlax-3d-point p1)
                     (vlax-3d-point (setq p2 (cdr (assoc 10 ent))))
                     (vlax-3d-point (setq p2 (cdr (assoc 10 ent))))
                   )
       )
       (setq ang (angle p1 p2))
       (cond ((and (>= ang (/ pi 2.)) (<= ang (+ pi (/ pi 2.))))
              (setq ang (+ ang pi))
             )
             ((= ang pi) (setq ang (- ang pi)))
             ((> ang 0.0) (setq ang (- ang (+ pi pi))))
       )
       (vla-put-textrotation dimension ang)
       (setq p1 p2)
       (setq lst (cons (cdr (assoc -1 ent)) lst))
       (if (>= (length lst) 3)
         (setq lst (vl-remove (nth 0 (reverse lst)) lst))
       )
     )
   )
 )
 (princ "\n Written by Tharwat Al Shoufi")
 (princ)
)

Link to comment
Share on other sites

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