Author Topic: How to change the plot scale in my pagesetup?  (Read 4509 times)

0 Members and 1 Guest are viewing this topic.

MvdP

  • Guest
How to change the plot scale in my pagesetup?
« on: August 11, 2006, 07:16:27 AM »
I am creating a drawing setup routine and encountered a problem/question.

How can i change the plot scale in my pagesetup in lisp. (deafult in dwt is 1:1) to f.e. 1:100.?

It has something to do  with

Code: [Select]
vla-setCustomScale
but i can't figure this out.
« Last Edit: August 14, 2006, 07:06:55 AM by nivuahc »

Patrick_35

  • Guest
Re: How to do this.?
« Reply #1 on: August 11, 2006, 07:22:26 AM »
Hi
Use vla-put-StandardScale

ex :
Code: [Select]
(setq tra (vla-item (vla-get-layouts (vla-get-activedocument (vlax-get-acad-object))) 0))
(vla-SetCustomScale tra 1.0 100.0)
or (vla-put-StandardScale 26)
@+
« Last Edit: August 11, 2006, 07:36:51 AM by Patrick_35 »

MvdP

  • Guest
Re: How to do this.?
« Reply #2 on: August 11, 2006, 07:42:12 AM »
Maybe a stupid question.But how do i do that.?

Ok i see. Thanks.
« Last Edit: August 11, 2006, 07:44:38 AM by MvdP »

MvdP

  • Guest
Re: How to do this.?
« Reply #3 on: August 11, 2006, 08:13:09 AM »
And how can change the the papersize from f.i. A0 to A1.?

I thougt this

Code: [Select]
(setq putformaattolayout (vla-item (vla-get-layouts (vla-get-activedocument (vlax-get-acad-object))) 0))
(vla-CanonicalMediaName putformaattolayout ISO_expand_A0_(841.00_x_1189.00_MM) ISO_expand_A1_(594.00_x_841.00_MM))


 was the way to go.But gives me this error.

error: no function definition: 841

Patrick_35

  • Guest
Re: How to do this.?
« Reply #4 on: August 11, 2006, 09:34:18 AM »
Code: [Select]
(vla-put-CanonicalMediaName tra "A1")
And for the lisp of paper
Code: [Select]
(defun format_papier(imp / def esp n lay lst)
  (if (zerop (getvar "tilemode"))
    (setq esp (vla-get-paperspace (vla-get-ActiveDocument (vlax-get-acad-object))))
    (setq esp (vla-get-modelspace (vla-get-ActiveDocument (vlax-get-acad-object))))
  )
  (setq lay (vla-get-layout esp) def (vla-get-configname lay))
  (if (not (vl-catch-all-error-p (vl-catch-all-apply 'vla-put-configname (list lay imp))))
    (progn
      (vla-RefreshPlotDeviceInfo lay)
      (setq lst (mapcar '(lambda (x) (vla-GetLocaleMediaName lay x)) (vlax-safearray->list (vlax-variant-value (vla-GetCanonicalMediaNames lay)))))
      (vla-put-configname lay def)
    )
    (setq lst '(""))
  )
  lst
)

(format_papier (vla-get-configname tra))

@+
« Last Edit: August 11, 2006, 09:39:32 AM by Patrick_35 »

MvdP

  • Guest
Re: How to do this.?
« Reply #5 on: August 11, 2006, 01:01:26 PM »
Thanks Patrick_35
I will try this

Code: [Select]
(setq tra (vla-item (vla-get-layouts (vla-get-activedocument (vlax-get-acad-object))) 0))
(vla-SetCustomScale tra 1.0 100.0)
(vla-put-CanonicalMediaName tra "A1")


 on monday when i am back at work.
Right know i am having my well deserved weekend.
« Last Edit: August 11, 2006, 01:09:21 PM by MvdP »

MvdP

  • Guest
Re: How to do this.?
« Reply #6 on: August 14, 2006, 02:18:23 AM »
This is driving me mad.When i load this routine (ap)


Code: [Select]
(setq getopzetschaal schaal)
(setq putplotschaaltolayout (vla-item (vla-get-layouts (vla-get-activedocument (vlax-get-acad-object))) 0))
(vla-SetCustomScale putplotschaaltolayout 1.0 getopzetschaal)
(vla-put-CanonicalMediaName putplotschaaltolayout "ISO_expand_A1_(841.00_x_594.00_MM)")

it is working (except is it rotated from landscape to portrait) but when i implement this

Code: [Select]

(defun putinfotolayoput(/)
(setq getopzetschaal schaal)
(setq putplotschaaltolayout (vla-item (vla-get-layouts (vla-get-activedocument (vlax-get-acad-object))) 0))
(vla-SetCustomScale putplotschaaltolayout 1.0 getopzetschaal)
)

(if (= tm "J")(putinfotolayoput))

in my drawing setup routine it is not.It gives the following error

Code: [Select]
ActiveX Server returned an error: Parameter niet optioneel
What am i doing wrong.? And can i change the orientation  from portrait to landscape.?




Edit..........1


I got figured out.
But one questions stays.How to change the orientation.?

Edit..........2
I got figured out again.I changed the orientation this way
Code: [Select]
(vla-put-PlotRotation putalltolayout 0)
« Last Edit: August 14, 2006, 05:06:11 AM by MvdP »

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: How to do this.?
« Reply #7 on: August 14, 2006, 04:58:43 AM »

Edit..........


I got figured out.

It would be nice if you shared the solution that you have used.
you could even post your complete routine, with a description of what it does ... this would help people trying to follow the thread ... now and next month.
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

MvdP

  • Guest
Re: How to do this.?
« Reply #8 on: August 14, 2006, 05:17:31 AM »
The solution for the problem was simple i misplaced the defun section.
And i can post the complete code( unfortunately all in Dutch) but it is still in progress and not completely done.And this is what it eventually should do.

- Choose drawing scale
- choose drawing format
- Choose if border should be drawn
- Choose to set it up in model or papaerspace(if ps put scale and forrmat to layout and create view)
- Make all dimensions and styles
- Choose which layers should be made.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: How to do this.?
« Reply #9 on: August 14, 2006, 05:49:17 AM »
Have you had a look at the PSETUPIN command ?
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

MvdP

  • Guest
Re: How to do this.?
« Reply #10 on: August 14, 2006, 06:01:23 AM »

Have you had a look at the PSETUPIN command ?


Yes off course i did.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: How to do this.?
« Reply #11 on: August 14, 2006, 06:06:22 AM »
OK,
The only reason I ask is because I find it excellent for setting up plot configs without resorting to hard coding a plot configuration.

kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.