dxf import from layout/paper space - can it be possible?

Discussion about writing code for Inkscape.
sanzoghenzo
Posts: 22
Joined: Wed Dec 12, 2012 8:04 pm

dxf import from layout/paper space - can it be possible?

Postby sanzoghenzo » Sat Dec 22, 2012 1:56 am

Hi there, I'm trying to set up an architectural illustration workflow, that involves CAD, Inkscape and GIMP.
Now the CAD is Archichad because i got the educational version for free, but maybe I'll move to blender, freecad and/or draftsight for a more open/free workflow.
Anyway, I did a fast layout using Archicad (but the same can apply to DS or AutoCAD), just to orient and take only parts of the drawing.
The current DXF importer outputs only the model space (and pust also entities that are only on the paper space, but this is a minor bug).
I would like to be able to import the paper space (just as illustrator does), so I started to dive into DXF specifications and dxi import plugin.
I found the codes and groups needed to setup the correct document size and to know positions and geometries of all the viewports, and the extension of the model space that is enclosed on that view (with center point, height and rotation).
I'm a noob at SVG, so I didn't figure out how to take all the entities (that dxf import extension already reads) that will be on the view and scale and rotate them to suit the viewport, maintaining their layers.
Also, another case is when you have multiple viewports on a layer that shows the same model space extent: should I read all the dxf entities twice?

Should I just give up with paper space in cad and do all the work in inkscape? The thing is, with big drawings it's slower to do it in inkscape than in cad...

User avatar
Inkspots
Posts: 232
Joined: Sat Dec 03, 2011 3:16 am

Re: dxf import from layout/paper space - can it be possible?

Postby Inkspots » Tue Jan 01, 2013 8:23 am

I don't use cad software, so I cant recommend either creating your file in cad, and Importing, or just making everything in Inkscape...the work flow that is best for you should be what you choose.
However, it would be nice if someone who has experience working with Inkscape in conjunction with Cad programs would answer your questions.
It sounds like your having a problem that makes you consider giving up on either Cad, or Inkscape, but from your description I cant really tell what that is.
you said:
I'm a noob at SVG, so I didn't figure out how to take all the entities (that dxf import extension already reads) that will be on the view and scale and rotate them to suit the viewport, maintaining their layers. Also, another case is when you have multiple viewports on a layer that shows the same model space extent: should I read all the dxf entities twice

Could you please explain more simply what your trying to do, and tell us how it isn't working?
it seems you are asking if the file contents should be read once for each view port, and it would be interesting to know what the answer is.
Sorry I cant actually help, :cry:

sanzoghenzo
Posts: 22
Joined: Wed Dec 12, 2012 8:04 pm

Re: dxf import from layout/paper space - can it be possible?

Postby sanzoghenzo » Fri Mar 15, 2013 10:20 pm

Hi Inkspots, thanks for you reply and sorry for this late reply (I have a strange relationship with forum notifications :) )

I think the reason you didn't understand my question is that you don't use cad software ;) let's try to explain more:
In cad (autocad over all) you have a model space where you draw everything you need, regardless of the layout. Then you have one or more paperspace to arrange your drawing on paper (after choosing the target paper size, printer, etc). You can take portions of the model space, setting the right scale and rotate it. you can also choose what layers to show, so in a page you can have, i.e., the same plane with or without furniture, quotes, and so on (or you can put them on multiple pages). This areas are called viewports.
If you wish you can also draw directly on the paperspace to add some layout elements (like borders, titles ecc)

I wish to use this paperspace to start my visualization workflow (cad->inkscape->gimp->inkscape), but dxf importer imports all the entities without checking if there are in the paperspace or in the model space. Ifiled a bug on launchpad for that.
Also, I opened a wishlist entry on launchpad to ask for paper space support on dxf importer, since I understood how dxf works but I don't have the experience to translate it to svg.
Ideally, the new dxf importer will let you choose if you want to import model space or paper space, and which one. When you select what paperspace to import, for every layout viewport it will do some math to take only the elements shown, scale and rotate them, then trim the elements outside the viewport.

For now, the only thing that works is use only the model space and do the first layout in there, but it's like using half the capabilities of cad software.


Return to “Programming”