PYTHON CODING HELP DXF to DWG

PYTHON CODING HELP DXF to DWG

nicolasR6NGC
Contributor Contributor
2,110 Views
5 Replies
Message 1 of 6

PYTHON CODING HELP DXF to DWG

nicolasR6NGC
Contributor
Contributor

I'm on Autodesk LT so I can't use win32 to automate saving a dwt or dxf into a dwg for xref. Is there another work around to get this process done?

Background:

I've made a lisp that references a python exe that takes a KMZ path and creates a box region around it so that another script can create a shape file that contains all parcel geometry within that region.

From here I would like to automatically xref it into the open file that ran the intial lisp. The problem I have is getting the geometry into a dwg. I have tried opening and placing it into a dwt and saving it as a dwg but I can't access the dwt via python for some reason. This would be the ideal path so that I can store it into a template as well but is not necessary. What I can do is save it as a DXF so if I can automatically convert this to a dwg then auto reference it then I can work around the problem. If there is a better solution that comes to mind I'd love to hear it but for now I'm looking into how to convert this and reference it automatically. Any ideas? 

 

@nicolasR6NGC - moderation edited title for clarity. 

0 Likes
Accepted solutions (1)
2,111 Views
5 Replies
Replies (5)
Message 2 of 6

CodeDing
Mentor
Mentor
Accepted solution

@nicolasR6NGC ,

 

Why not have Python just write a text file (like CSV), then have lisp read the file and create the objects?

 

Message 3 of 6

nicolasR6NGC
Contributor
Contributor

Oh that's a great idea thank you!

Message 4 of 6

nicolasR6NGC
Contributor
Contributor

I just realize this will likely not work due how curves will be handled.

0 Likes
Message 5 of 6

CodeDing
Mentor
Mentor

@nicolasR6NGC ,

 

To my knowledge, KMZ/KML/Shapefiles do not support curves. Should work just fine

 

Message 6 of 6

nicolasR6NGC
Contributor
Contributor

Ah your right I viewed it in CAD just now and the curves are composed of multiple lines.