Jump to content

_dimreassociate, is there a quicker way to do an entire drawing?


Recommended Posts

i don't know of any reassociation commands or lisps either, as far as snapping to another dimention, yes, it has all the same snaps a regular entity would have, in fact i often snap to its baseline nodes.

Link to comment
Share on other sites

Playing around, this will work on Aligned dimensions. It's VERY hacky.

 

(defun c:ReAss (/ ss i e d pt)
 (if (setq ss (ssget "_:L" '((0 . "DIMENSION"))))
   (repeat (setq i (sslength ss))
     (if
       (and (eq (cdr (assoc 100 (reverse (setq d (entget (setq e (ssname ss (setq i (1- i)))))))))
                "AcDbAlignedDimension"
            )
            (nentselp (setq pt (trans (mapcar '(lambda (a b) (/ (+ a b) 2.))
                                              (cdr (assoc 13 d))
                                              (cdr (assoc 14 d))
                                      )
                                      0
                                      1
                               )
                      )
            )
       )
        (progn (command "_.dimreassociate" e "" "_S" "_non" pt)
               (while (eq 1 (logand 1 (getvar 'CMDACTIVE))) (command ""))
        )
     )
   )
 )
 (princ)
)

Link to comment
Share on other sites

Thanks everyone!

 

1. I don't think so.

 

2. Why do you want to snap to a dimension and not the original geometry?

 

It is hard to explain, but I have a few dimensions that the intersection is where another dimension intersects a circle.

 

I can get around it by drawing a line along the other dimension, but that just seems messy to me, but seems to be my only option.

 

 

 

i don't know of any reassociation commands or lisps either, as far as snapping to another dimention, yes, it has all the same snaps a regular entity would have, in fact i often snap to its baseline nodes.

 

You can snap to the dimension, but it will not associate.

 

ReAss? :lol:

 

That's just too funny.

 

alanjt, I will give ReAss a good look tomorrow. :shock:

 

Here is a visual of the Intersection with Dimension. These are mill rolls that are adjusted and reset often, I will be able to really speed things up if I could get all the dims associated.

Link to comment
Share on other sites

Plain ACAD will snap to dimensions, Mechanical requires you to use AMPOWERSNAP to filter dimensions so you can snap to them.

Link to comment
Share on other sites

I would put a node where the dimension crosses the dashed circle and snap to that.

 

With a node I would have to physically move the node whenever I relocated center points and resized my Radius', that does give me an idea though, I my have to create some Dynamic Blocks to achieve my results and then I could maybe use point parameters, I will have to check into that.

 

Plain ACAD will snap to dimensions, Mechanical requires you to use AMPOWERSNAP to filter dimensions so you can snap to them.

 

No problem snapping to a dimension, it is associating to that dimension.

 

You can snap to the dimension, but it will not associate.

 

I haven't used Mechanical in awhile, when you change geometry, do the dimensions automatically correct themselves? I believe Pro/E and Inventor do.

 

Maybe I will need to get my boss looking into an upgrade to Mechanical or Inventor. They are already looking into moving to AutoPlant or Plant 3d.

Link to comment
Share on other sites

Playing around, this will work on Aligned dimensions. It's VERY hacky.

 

It actually works GREAT. A simple QSELECT then a ReAss. :? Really good time saver.

 

Thanks Alan!

Link to comment
Share on other sites

It actually works GREAT. A simple QSELECT then a ReAss. :? Really good time saver.

 

Thanks Alan!

Glad it helps. It's ugly as hell, but who cares.

Link to comment
Share on other sites

  • 7 years later...

Hi,

 

How is this Alans routine suppose to work? I've tried snapping to other dims and running it. But now I feel like an ass, I don't know what I'm doing wrong.

 

EDIT: It was AcDbRotatedDimension I was trying it on.

 

Is there a routine that works with dims in PS that lie directly on an endpoint for example?

Looking at this code it's way beyond my abilities at the moment.

Link to comment
Share on other sites

  • 4 years later...

Adding something to this, it was linked to from another question (see below)

 

Quote

It's VERY hacky.

 

Couple of things I found was that if the dimension was off the screen then it gave me an error, and if end A or End B were not on an entity then it paused for user input - tried to fix that below:

 

(defun c:reass ( / DimEnt MyDim Pta Ptb EndA EndB EndA_Lines EndB_Lines)
  (setq DimEnt (car (entsel)))     ;Select a dimension (change this to ssget, filtered with dimensions and do a loop
  (command "_zoom" "O" DimEnt "")  ; Zoom to the dimension
  (setq MyDim (entget DimEnt))     ; Get the entity definition
  (setq Pta (cdr (assoc 13 MyDim))); Leg A end pint
  (setq Ptb (cdr (assoc 14 MyDim))); Leg B end point

  (setq EndA_Lines (ssget "_C"
       (mapcar '+ Pta (mapcar '/ Pta '(1000 1000 1000)))
       (mapcar '- Pta (mapcar '/ Pta '(1000 1000 1000)))
       '((0 . "LINE"))
  )) ; select entities close to end of dimension line (ie touching or just missing)

  (setq EndB_Lines (ssget "_C" 
       (mapcar '+ Ptb (mapcar '/ Pta '(1000 1000 1000)))
       (mapcar '- Ptb (mapcar '/ Pta '(1000 1000 1000)))
       '((0 . "LINE"))
  )) ; select entity close to end of dimension line

;  (command "dimreassociate" DimEnt "" "end" Pta "end" Ptb) ; ignored - reassociated both ends at once
  (if EndA_Lines                    ; if any lines were near / touching End A, reassociate
    (command "dimreassociate" DimEnt "" "end" Pta "")
  )
  (if EndB_Lines                    ; if any lines were near / touching End B, reassociate
     (command "dimreassociate" DimEnt "" "end" "" "end" Ptb )
  )
  (command "_zoom" "previous") ; Zoom back to original zoom.
;;repeat selection set loop from here
)

 

 

 

 

Link to comment
Share on other sites

  • 5 months later...

Here is one of mine incorporating some other stuff I saw above. I don't know if it all goes together but it seems to work pretty well. I Dimension in paperspace so it's kind of

made to my preferences but should work in model to.

(defun c:CrowdControl (/ ss i ent p13 p14)

    ;; System variables to be modified within the program
    (setq var '(cmdecho aperture pickbox)
    ;; Retrieve current sys var values
   val  (mapcar 'getvar var)
    ) ;; end setq

 
(mapcar 'setvar '(cmdecho aperture) (list 0 50))
  (if (setq ss (ssget '((0 . "DIMENSION"))))
    (repeat (setq i (sslength ss))
      (setq ent (ssname ss (setq i (1- i))))
      (command  "_zoom" "O" Ent "")
      (setq MyDim (entget Ent))
      (setq Pt13 (cdr (assoc 13 MyDim)))
      (setq Pt14 (cdr (assoc 14 MyDim)))

      (setq EndA_Lines (ssget "_C"
           (mapcar '+ Pt13 (mapcar '/ Pt13 '(1000 1000 1000)))
           (mapcar '- Pt13 (mapcar '/ Pt13 '(1000 1000 1000)))
           '((0 . "DIMENSION"))
      )) ; select entity close to end of dimension line

      (setq EndB_Lines (ssget "_C" 
           (mapcar '+ Pt14 (mapcar '/ Pt13 '(1000 1000 1000)))
           (mapcar '- Pt14 (mapcar '/ Pt13 '(1000 1000 1000)))
           '((0 . "DIMENSION"))
      )) ; select entity close to end of dimension line

      (if (and (vl-position (cdr (assoc 100 (reverse (entget ent)))) '("AcDbAlignedDimension" "AcDbRotatedDimension"))
	       (setq p13 (cdr (assoc 13 (entget ent))))
	       (setq p14 (cdr (assoc 14 (entget ent))))
	       )
	(command "pickbox" "1"  "_.DIMREASSOCIATE" ent "" "_end,_mid,_quadrant,_center" p13 "_end,_mid,_quadrant,_center" p14))))
      (command "_zoom" "previous" "")
    (mapcar 'setvar var val) 
  (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...