Jump to content

Recommended Posts

Posted

This use to work properly but now the nomutt variable doesn't suppress the dimlinear command.

 

;;------------------------------------------------------------------------------------------------------------;;
;; Create Overall Dimension for Everything Selected.
(defun C:ODIM (/ SS UL LL UR LR ML MB oLL oUR)
  (if (ssget "_I")        ; if there are preselected objects [= Implied selection]
    (sssetfirst nil (setq SS (ssget "_I")))
    (setq SS (ssget))
  )
  (if (/= SS nil)
    (progn
      (BBox) ; overall bounding box lisp outputs LL UR points
      (setq
        UL (list (car LL) (cadr UR))
        LR (list (car UR) (cadr LL))
        ML (polar LL 1.5708 (/ (distance LL UL) 2))
        MB (polar LL 0 (/ (distance LL LR) 2))
      )
      (setvar 'nomutt 1)
      (if (tblsearch "LAYER" "Dimensions")
        (setvar 'clayer "Dimensions")
        (vl-cmdf "-Layer" "M" "Dimensions" "C" "7" "" "")
      )
      (vl-cmdf "_.Dimlinear" "_non" LL "_non" UL "_non" (polar ML 3.14159 1))
      (vl-cmdf "_.Dimlinear" "_non" LL "_non" LR "_non" (polar MB 4.71239 1))
      (setvar 'nomutt 0)
    )
  )
  (princ)
)

must have change a system variable somewhere any ideas? Also tried expert 5 still showing up.

 

: _.Dimlinear
Origin of first extension line <Select entity>:_non
 Origin of second extension line:_non
 [Angle/Text/Horizontal/Vertical/Rotated]:_non
 Dimension text: = 22.005
: _.Dimlinear
Origin of first extension line <Select entity>:_non
Origin of second extension line:_non
[Angle/Text/Horizontal/Vertical/Rotated]:_non
Dimension text: = 15.885

 

Posted (edited)

cmdecho?

 

or create dim as shown in official help documentation :

 

http://help.autodesk.com/view/ACD/2015/ENU/?guid=GUID-9F5CE147-3787-4DD9-8028-8E89BF02A357
 

(vl-load-com)
(defun c:Example_AddDimAligned()
    ;; This example creates an aligned dimension in model space.
    (setq acadObj (vlax-get-acad-object))
    (setq doc (vla-get-ActiveDocument acadObj))
    
    ;; Define the dimension
    (setq point1 (vlax-3d-point 5 5 0)
          point2 (vlax-3d-point 10 5 0)
          location (vlax-3d-point 5 7 0))
    
    ;; Create an aligned dimension object in model space
    (setq modelSpace (vla-get-ModelSpace doc))
    (setq dimObj (vla-AddDimAligned modelSpace point1 point2 location))
    (vla-ZoomAll acadObj)
)
Edited by rlx
Posted (edited)

I have a start and end macros that handle cmdecho along with some other system variables. i took them out but looks like i left in (bbox)

 

ill try the vla stuff tomorrow.

Edited by mhupp
Posted
14 hours ago, mhupp said:

and end macros that handle cmdecho along with some other system variables.

 

LOL answered my own question had a dimstyle command call right after nomutt is set to 1 that was turning it back to 0 in the end macro.

 

much cleaner now

 

: ODIM
Select entities:
Opposite Corner:
Entities in set: 1
Select entities:

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