Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations GregLocock on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Scaling in one direction only

Status
Not open for further replies.

victroladoctor

Civil/Environmental
Dec 13, 2006
10
Is it possible to scale one in the x direction and not in the y direction?
 
Replies continue below

Recommended for you

victroladoctor,

what do you want to scale?
You can convert objects into blocks.
blocks can be scaled with two different values.

Lothar

ADT 2004
 
This works fairly well; essentially it creates a block, inserts it with a user defined scale factor, explodes the block and then purges. It explodes plines though. Thanks to an unknown author.
Code:
;;;SCALEAXIS.LSP

;--------------------------------------------------
; ERROR TRAPPING
;--------------------------------------------------

(defun errtrap (msg)
  (cond
    ((not msg))
    (
      (member msg '("Function cancelled" "quit / exit abort"))
      (command "undo" "")
    )
    (
      (princ (strcat "\nError: " msg))
      (command "undo" "")
    )
  );cond
);defun

;--------------------------------------------------
;  MAIN ROUTINE
;--------------------------------------------------

(defun c:scaleaxis (/ *error* *ss1 bspt ax mult refpt refdx newdx)

(command "._undo" "end" "._undo" "begin")
(setq *error* errtrap)

(setq ss1 (ssget))
(setq bspt (getpoint "\nSelect basepoint: "))
(initget "X Y Z")
(if
  (not
    (setq ax (getkword "\nSpecify axis to scale: <X> "))
  );not
  (setq ax "X")
);if

(if
  (not 
    (setq mult (getreal "\nEnter scale factor or <Reference>: "))
  );not
  (progn
    (setq refpt1 (getpoint "\nSpecify reference length: "))
    (setq refdx (getdist refpt1 "\nSpecify second point: "))
    (setq newdx (getdist refpt1 "\nSpecify new length: "))
    (setq mult (/ newdx refdx))
  );progn
);if

(setvar "expert" 2)
(setvar "explmode" 1)
(command "._-block" "SCALETEMP" bspt ss1 "")
(command "._-insert" "SCALETEMP" ax mult bspt "0")
(command "._explode" "last" "")
(command "._-purge" "blocks" "SCALETEMP" "n")
(setvar "expert" 1)

(command "._undo" "end")

(princ)
(*error* nil)
)

____________________
Acad2006, Terramodel
 
The whole drawing was converted from a pdf and somehow the scaling was off. I tried to make the whole drawing a block but ACAD was asking for a parameter and it would not accept any answers I gave it. If you could explain how to scale a block in one direction, I would appreciate it.

The scaleaxis is a bit (depending on the scale) or a lot over my head> But nothing beats a failure but a try.

Thanks to both of you. Happy thanksgiving
 
The scaling of a block can only be done after the drawing was made into a block. Assuming that you have made a block, go to the insert pull down menu and select block, the insert block on the screen will ask for scale in the x,y,directions-just fill in the value, then OK and the block drawing with its new scale value will appear.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor