Jump to content

SCALE routine to explode and scale dimensions...


lamensterms

Recommended Posts

Hey guys,

 

Just wondering if I could please get some assistance conjuring up a SCALE routine which will warn the user if they are about to scale dimensions, and then explode any dimensions (if they are included in the selection set).

 

I am currently working on a set of drawing which require a lot of enlarged details (details scaled at 2:1, 5:1, etc).

 

The idea would be to draw and dimension the detail at 1:1, then scale up to whatever size required. The routine would provide an alert if any dimensions were selected in the SCALE selection set, and then explode any dimensions selected prior to scaling them up, so the dimension is no longer "live".

 

Any direction would be greatly appreciated, or if anyone has any suggestions on a better solution for this situation?

 

Thanks a lot for any help.

 

Ps, we produce our 2D shop drawings in individual .DWGs, in model space. Due the the method we use to create our shop drawings (ProSteel) using viewports in layout space is, unfortunately, not an option.

Link to comment
Share on other sites

Hey BigAl,

 

Thanks for the reply.

 

I'm not really fussed about the dimension text height at this stage - rather the value.

 

Our current procedure is (for example):

 

For a drawing at a scale of 1:1 (but a DIMSCALE factor of 10) - and to create an enlarged detail 2x the size on that same drawing (enlarged detail scale would be 2:1). Current DIMSCALE = 10.

 

1. Set DIMSCALE to 5 (also text height should reflect DIMSCALE).

2. Create and dimension detail as required.

3. Explode all dimensions associated with detail (so the values will not be altered when the detail is scaled up).

4. Scale detail and dimensions by scale factor of 2.

5. Reset DIMSCALE to drawings native scale - 10.

 

The intention is to combinethe above steps 3 & 4 into the scale command.

 

I hope that explanation was logical haha.

 

Thanks again.

Edited by lamensterms
Link to comment
Share on other sites

If the preference is to keep the dimensions live (i.e., not exploded) then, perhaps, the dim’s LinearScaleFactor property could be set inverse to the detail scaling.

Link to comment
Share on other sites

Hi guys,

 

SEANT the LinearScaleFactor could be a good option. Would there be a way to get that value to adjust according to the scale, to main a constant dimension value?

Link to comment
Share on other sites

Hi guys,

 

SEANT the LinearScaleFactor could be a good option. Would there be a way to get that value to adjust according to the scale, to main a constant dimension value?

I am no math wizz but would it be LSF = SF * -1? Did I just prove I hate numbers?
Link to comment
Share on other sites

Hi guys, yep that sounds pretty good, thanks for the suggestion.

 

What would the code be to modify the LSF for any dimensions included in the SCALE selection set?

Link to comment
Share on other sites

Hi guys, yep that sounds pretty good, thanks for the suggestion.

 

What would the code be to modify the LSF for any dimensions included in the SCALE selection set?

 

 

I'm not particularly fluent in Autolisp - perhaps this thread has some useful information.

http://www.cadtutor.net/forum/showthread.php?53140-selec-dims-and-change-linear-dim-scale&highlight=LinearScaleFactor

Link to comment
Share on other sites

Thanks for the link SEANT, I have had a look at that thread... The code shown there is a little too advanced for me.

 

I think I can follow the math ok though. I need to set the LSF each time I scale, according to the current LSF and the new SF.

 

What I'm struggling with at the moment though, is separating the dimensions from the scale selection set. So currently I can create a selection set for the SCALE command to operate on, but how can I create a second selection set of dimensions only, obtained from the SCALE selection set?

 

Thanks again.

Link to comment
Share on other sites

That sounds like it might be a good job for the FILTER command.

Setting up the FILTERS takes a couple minutes, so consider saving them

for future use, on the fly, with the SAVE AS option in the dialog box.

 

Or maybe using LAYISO would be easier, and just select them.

Link to comment
Share on other sites

Hi Dadgad,

 

Thanks for the reply, I think I am making progress (slowly).

 

I"ve got this code below:

 

(defun c:nsc ( / )
(setq ss1nsc (ssget))
 (if (setq ss2nsc (ssget "P" '((0 . "dimension"))))
   (PROGN
   (alert "Dims selected!")
   (command "explode" ss2nsc)
   (setq ss3nsc (ssget "P"))
   )
 )

(command "scale" ss1nsc ss3nsc "" pause (setq sfnsc (getreal)))

)

 

This code kinda works, experiementing with the possibility of exploding the dimensions - but it will only explode 1 dimension from the selection set. Any ideas on how to get the full DIMENSION selection set to get passed to the EXPLODE command?

Link to comment
Share on other sites

  • 3 weeks later...

Hey guys,

 

So I've got the following code working OK.

 

(defun c:psc ( / I L SS1NSC SS2NSC SS3NSC )
(setq ss1nsc (ssget))
 (if (setq ss2nsc (ssget "P" '((0 . "dimension"))))
   (PROGN
    (repeat (setq i (sslength ss2nsc))
     (setq l (cons (ssname ss2nsc (setq i (1- i))) l))
   (command "explode" ss2nsc)
   (command "select" ss3nsc "P" "")
   (setq ss3nsc (ssget "P"))
    )

   )
 )

(command "scale" ss1nsc ss3nsc "" pause pause)

)

 

I've used:

(command "select" ss3nsc "P" "")
(setq ss3nsc (ssget "P"))

 

To add each exploded dimension to the selection set and it accumulates for every REPEAT.

 

Happy to get some feed back on a more efficient way to get this done, but it does work for now.

 

Looking forward to hearing back.

Edited by lamensterms
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...