[PythonCAD] printing

phrostie pfrostie at yahoo.com
Sat Jul 10 13:37:37 CEST 2004


With later releases of Catia V4 and now with Catia V5 the older paperspace 
view ports have been droped for what was called AUX2 in V4.  this has more 
seperation between the 3D and the 2D environment.  the 3D model is rendered 
to create seperate 2D geometry that exists in a floating viewport that can be 
moved around in the drawing area.

> Well,  AutoCAD uses a 'model space' and 'paper space' concept.  That is,
> the model is a drawing at real-world dimensions and the layout is on a
> sheet of paper (with real paper-size dimensions.)
>
> The way it (and others including catia and pro-e (can anyone say about
> microstation?)) handles displaying the model in paper space is that you
> create 'viewports'.  So, if you had a 3D model, you could create a layout
> with 4 viewports (and you can clip these viewports, rotate the view, set
> the scale for each one, etc,etc)  If you only have a 2D drawing this can
> still be useful to show e.g. details or even just to re-arrange the drawing
> layout without changing the model-view content/positioning.  Freezing
> layers can also be done on a per-viewport basis.
>
> My suggestion here is that rather than trying to replicate the paperspace
> functions and creating a viewport entity (which only exists in paperspace)
> that  you simply make block or xref-like entities which behave like
> viewports.
>
> I think there is a lot of discontinuity (for the programmer and the user)
> with AutoCAD's model of paper-space.  Particularly when you are dealing
> with a 2D-only cad application.  With 3D modelers like Catia and Pro-E it
> is quite different (here, paperspace is a necessary thing and drafted
> representations of models are different than the models.)
>
> So, consider this:  I draw three views of my project in pythoncad, and save
> this as project.xml.gz.  In this file, I've got multiple layers defined
> (I'll creatively call them 1 and 2.)  Now,  I create a new pythoncad
> drawing (maybe starting from a template for 24x36 paper) and I instantiate
> project.xml.gz twice (positioning two of my three views with layer 1
> active) and then add my title-block and etc.  I'll save this as
> sheet1.xml.gz and go on to create another 24x36 layout with view 2 & 3 and
> layer 2 active.  This, I'll save as sheet2.xml.gz.
>
> For all practical purposes, sheet1.xml.gz and sheet2.xml.gz are now
> equivalent to (layouts) printouts of my drawing (with everything as it
> should be, layers, scales, and etc.)  Maybe I print them now, or maybe I go
> back into project.xml.gz and make some changes.  Regardless, when I'm ready
> to print, I should not have to revisit my layouts (since I maybe created 5
> or 6 of them to print on various sizes of paper.)
>
> Given this scheme, here's how we batch plot:
>
> (where pycad2ps just draws in postscript format exactly what pythoncad
> would display on-screen)
>
> for i in 1 2 ;do pycad2ps -c sheet$i.xml.gz |lp -P24x36plotter ;done
>
> Printing from inside of pythoncad should essentially perform the same
> operation, which means that print and export are equivalent except that
> 'print' means 'send a postscript export format to this printer'.
>
> --Eric

-- 
Oh i've slipped the surly bonds of DOS 
and danced the skies on Linux silvered wings.
http://pfrostie.freeservers.com/cad-tastrafy/
http://www.freelists.org/webpage/cad-linux
http://www.freelists.org/webpage/cad-linux-dev


More information about the PythonCAD mailing list