Author Topic: what about this one?  (Read 2464 times)

0 Members and 1 Guest are viewing this topic.

hospitaller

  • Guest
what about this one?
« on: November 21, 2005, 06:55:37 PM »
We're trying to scale down a bunch of old files, basically scale down to 50% the titlesheets, the text blocks and the viewports using ),) as the origin, thats the easy part.

We'd also need to change the scale of the viewport to reflect the new scaled down size, thats also fairly easy, the problem is, as you can imagine, that the already scaled down viewport "moved", so the contents of the viewport "shift".

Is there a way to make the contants of the viewports remain anchored relative to the center of the VP, so that when they scale down, and we manually change their scales, the contents remain perfectly aligned as they were originally?

Did I even make sense?

TIA

Hector Rojas

T.Willey

  • Needs a day job
  • Posts: 5251
Re: what about this one?
« Reply #1 on: November 21, 2005, 07:37:21 PM »
You would have to activate each model space viewport, get the value of cvport and then get the mid point like.
Code: [Select]
(mapcar '(lambda (a b) (/ (+ a b) 2.0)) (getvar "vsmin") (getvar "vsmax"))
Then scale all the viewports down, go back into each on, scale down the view, then pan form the new mid point, to the old one.

Just an idea.

Tim
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

Jeff_M

  • King Gator
  • Posts: 4100
  • C3D user & customizer
Re: what about this one?
« Reply #2 on: November 21, 2005, 07:42:12 PM »
Forgive me for not quite understanding, but what purpose would this serve? It won't reduce your file size, you can plot it at any scale you want to already, so I just don't see the point?!?!

I could probably give you a hand if you could convince me otherwise........

hospitaller

  • Guest
Re: what about this one?
« Reply #3 on: November 23, 2005, 10:33:21 AM »
We inherited a series of drawings that were NOT drawn in real world units,
they were drawn scaled up, don't ask, I just deal with the aftermath....

Anyway, we need to scale them down by a user defined percentage, origin
point 0,0 and then change the plot scale of the viewports, problem is, as
seen in the 2 images in the middle, the contents shift, if we change the
pl
otscale of the vport prior to scaling them down, we end up with the same
problem.

We need to be able to have the plotscale of the viewport somehow use PSPACE
0,0 to scale the vport contents.

Is this even possible?

Thanks in advance


Bob Wahr

  • Guest
Re: what about this one?
« Reply #4 on: November 23, 2005, 01:33:58 PM »
This is
  • Really quick
  • Really dirty
  • Not lisp
  • Not pretty
but shows you a way that it can be done.
Code: [Select]
Sub test()
Dim objEnt As AcadEntity
Dim objPVP As AcadPViewport
Dim dblBase(0 To 2) As Double
Dim dblScale As Double

dblScale = ThisDrawing.Utility.GetReal("Scale Factor: ")
dblBase(0) = 0: dblBase(1) = 0: dblBase(2) = 0

  For Each objEnt In ThisDrawing.PaperSpace
    If TypeOf objEnt Is AcadPViewport Then
      Set objPVP = objEnt
      objPVP.DisplayLocked = False
      objPVP.ScaleEntity dblBase, dblScale
    Else
      objEnt.ScaleEntity dblBase, dblScale
    End If
  Next objEnt

End Sub