Jump to content

Recommended Posts

Posted

Can I change the non associative dimension to associative by a lisp commandassocitiave.PNG.fd130bd65fcab0a7190a2c2e4b1783d3.PNG

Posted

Is it a LISP to run the dimreassociate command? (which will associate a dimension to a single item, not 2 items)

Posted

Just added this to the link from SLW210, below modified to select many dimensions.

 

Note the entity to dimension to are lines just now, should work with other entities, just change that line, 

 

 

(defun c:reass ( / DimEnt MyDim Pta Ptb EndA EndB EndA_Lines EndB_Lines)

  (if (setq ss (ssget '((0 . "DIMENSION")) )) ; select dimensions
   (repeat (setq i (sslength ss))    ; loop through selection set
     (setq DimEnt (ssname ss (setq i (1- i))))

      (command "_zoom" "O" DimEnt "")
      (setq MyDim (entget DimEnt))
      (setq Pta (cdr (assoc 13 MyDim)))
      (setq Ptb (cdr (assoc 14 MyDim)))

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

      (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)
      (if EndA_Lines (command "dimreassociate" DimEnt "" "end" Pta ""))
      (if EndB_Lines (command "dimreassociate" DimEnt "" "end" "" "end" Ptb ))
      (command "_zoom" "previous")
    ) ; end repeat
  ) ; end if
  (princ) ; end quietly
)

 

  • Thanks 1

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