Jump to content

Recommended Posts

Posted

One of the lisp gods here (alanjt) wrote this for me relatively recently

and I was wondering if/how it could be modified to change the

DIMASZ value to 1/2 of the current DIMSCALE.

Is it a good starting point or would I need a routine from scratch?

(DIMASZ controls the length of the jog in Ordinate dimensions for

anyone who does not know that already...)

 

I know a tiny little bit of autolisp but I know squat about VL.

 

Here is the code: (reformatted!)

 

(defun c:MO (/ #SS)
(cond
   ((setq #SS (ssget "_:L" '((0 . "DIMENSION"))))
    (or *AcadDoc* (setq *AcadDoc* (vla-get-activedocument (vlax-get-acad-object))))
    (vlax-for x (setq #SS (vla-get-activeselectionset *AcadDoc*))

[i];;I'm guessing I'd have to modify this somehow..[/i]

      (vl-catch-all-apply 'vla-put-centertype (list x acCenterNone))
    ) ;_ vlax-for
    (vl-catch-all-apply 'vla-delete (list #SS))
   )
 ) ;_ cond
 (princ)
) ;_ defun

 

I'm looking for two different flavors of this..

(I'll ask up front rather than ask after the fact!)

 

1) Change DIMASZ to 1/2 of Current DIMASZ value.

 

2) Enter a value for DIMASZ to change the selected dimensions to.

 

The default could be 1/2 the dimscale unless a value is entered.

I'm guessing anyway..

 

--

 

 

Thank you guys for everything and for sharing your knowledge

and coding for the less fortunate!!

 

 

ps: here is the original thread...

http://www.cadtutor.net/forum/showthread.php?t=45363

Posted

Bump!

 

HELP PLEASE!!!!

Posted

:huh:

 

(defun c:MO (/ ss size)
 (cond ((and (setq ss (ssget "_:L" '((0 . "DIMENSION"))))
             (setq size (cond ((getdist (strcat "Specify arrowhead size or half of DimScale <"
                                                (vl-princ-to-string (/ (getvar 'dimscale) 2.))
                                                ">: "
                                        )
                               )
                              )
                              ((/ (getvar 'dimscale) 2.))
                        )
             )
        )
        (or *AcadDoc* (setq *AcadDoc* (vla-get-activedocument (vlax-get-acad-object))))
        (vlax-for x (setq ss (vla-get-activeselectionset *AcadDoc*))
          (vl-catch-all-apply (function vla-put-centertype) (list x acCenterNone))
          (vl-catch-all-apply (function vla-put-arrowheadsize) (list x size))
        )
        (vl-catch-all-apply 'vla-delete (list ss))
       )
 )
 (princ)
)

Posted

Thank you! Thank you! Thank you! Thank you! Thank you! Thank you!

 

This is exactly what I asked for!!

 

I did make one mistake in my description...

I had to change:

 

)
                              ((/ (getvar 'dimscale) 2.))
                        )

 

to

)
                              ((/ (getvar 'dimasz) 2.))
                        )

 

But that was totally my fault in asking for the wrong thing..!!

 

I cannot thank you enough!

 

You guys are all so awesome!

Posted

You're welcome.

I had wondered about that, but I figured you knew something I didn't.

(getvar 'dimscale) is in there twice, so make sure you change it both times.

 

Happy CAD'ing. :)

 

Thank you! Thank you! Thank you! Thank you! Thank you! Thank you!

 

This is exactly what I asked for!!

 

I did make one mistake in my description...

I had to change:

 

)
                              ((/ (getvar 'dimscale) 2.))
                        )

to

)
                              ((/ (getvar 'dimasz) 2.))
                        )

But that was totally my fault in asking for the wrong thing..!!

 

I cannot thank you enough!

 

You guys are all so awesome!

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