Jump to content

Recommended Posts

Posted

I found a simple macro online and i have no clue how it works. I was wondering if someone could help me make a slight modification to it.

 

The macro below selects ALL the dimensions in your current drawings space and seems to put it on a selection set. Which is useful because I can run this in a script, and then run another command, such as ._CHANGE after it, and use the PREVIOUS subcommand. (all of the dimensions were 'Previously' selected by the macro)

 

(ssget "x" (list (cons 0 "DIM*")))

 

I need to tweek the macro shown above to do the same thing, but to only select all dimensions that are on a particular dimstyle. Such as "DIM_08".

 

Can anybody out there help me out with this??

 

For whatever reason the majority of the drafters in my office prefer to use 2 different dimstyle for every architechural scale there is, (one for paperspace and one for model), and alot of our drawings are getting out of wack because some people are using these dimstyle with assosiation. I can set everything else the way it needs to be using commands in a script, but I need help with selecting the dimensions on different dimstyles individually. Otherwise the changes I'm trying to make will apply to all dimensions no matter what dimstyle they are on.

Posted

Can someone please help with a Lisp?

 

I need a lisp (or script) that will...

 

1. Select only the dimensions on dimstyle
PAP-01
that have the variable
DIMLFAC
set to
16

 

2. Then, for only the dimensions that were selected, change the dimstyle to
DIM-16

 

The macro below will select all the dimensions using dimstyle PAP-01, but I need help expanding on it to do what's described above.

 

(ssget "x" (list (cons 0 "DIM*")(cons 3 "PAP-01")))

 

 

 

This stuff is WAY over my head and any help will be GREATLY appreciated

Posted

Nevermind guys I figured it out.

 

But just incase anyone has the same question in the future, here the code

 

(ssget "x" (list (cons 0 "DIM*")(cons 3 "PAP-01")))

Posted

The code is a little ambigous maybe you want to do something in between.

 

(setq ss (ssget "x" (list (cons 0 "DIM*")(cons 3 "PAP-01"))))
(command "_change" ss "" ......

also

FILTER DIM "PAP-01"

Posted

You would be better adding this onto your other post

 

If via lisp use a repeat you can walk through the selection set see my other post, and check that DIMLFAC is = 16

 

(repeat (setq x (sslength ss))
(setq obj (vlax-ename->vla-object (ssname SS (setq x (- x 1)))))
(if (= (val-get-LinearScaleFactor obj) 16))
(vla-put-StyleName  obj "DIM-16")
)
)

Posted

What am i doing wrong? I tried running it as a script and a lisp.

 

(setq ss (ssget "x" (list (cons 0 "DIM*")(cons 3 "PAP-01"))))
(command "_change" ss "" ......
(repeat (setq x (sslength ss))
(setq obj (vlax-ename->vla-object (ssname SS (setq x (- x 1)))))
(if (= (val-get-LinearScaleFactor obj) 16))
(vla-put-StyleName  obj "DIM-16")
)
)

Posted

The 2nd line was a suggestion not code

(defun AH:dimch ( / ss obj)
(setq ss (ssget "x" (list (cons 0 "DIM*")(cons 3 "PAP-01"))))
(repeat (setq x (sslength ss))
(setq obj (vlax-ename->vla-object (ssname SS (setq x (- x 1)))))
(if (= (val-get-LinearScaleFactor obj) 16))
(vla-put-StyleName  obj "DIM-16")
)
)
)
(AH:dimch)

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