Inventor DWG to AutoCAD DWG

Inventor DWG to AutoCAD DWG

Jason.Rugg
Collaborator Collaborator
1,007 Views
7 Replies
Message 1 of 8

Inventor DWG to AutoCAD DWG

Jason.Rugg
Collaborator
Collaborator

Using LISP I have created code that takes an exported AutoCAD DWG (from Inventor DWG) and separates model geometry from annotation geometry and places each into their respective space (model space/paper space). The code also remaps layers and other company standards that normally get applied to AutoCAD drawings.

 

The problem I am having is with detail views that are scaled differently than the base view. The code takes the exported drawing and scales the two spaces accordingly so that everything in model space is 1:1 (except details) and in paper space scales borders/titleblocks/symbols/dimensions/text/etc. up or down to a certain size paper layout and then applies the correct dimension styling and scaling to make it all appear correctly.

 

Is there a way though code, lisp or ilogic, to isolate views/geometry that use a different scale from the base view and scale the geometry back to 1:1?

0 Likes
1,008 Views
7 Replies
Replies (7)
Message 2 of 8

CodeDing
Advisor
Advisor

@Jason.Rugg ,

 

Forgive me if I'm trying to simplify this too much, but I do not use Inventor.. Are you asking, for example, that if you Export a 1" diameter circle from Inventor, and in AutoCAD that circle is now 0.5" diameter, how to get the circle back to a 1" diameter?

0 Likes
Message 3 of 8

Jason.Rugg
Collaborator
Collaborator

@CodeDingSo with Inventor drawings there is no model space/paper space per say. You can export out a AutoCAD dwg and have all model geometry only go to model space at 1:1. In my case I also need annotation geometry as well, so when I export send everything to paper space so it captures everything. The problem with this export option is all views are scaled off the base view scale, so all views that use the base view scale will be 1:1 and dimension accurately but if you have a scaled detail view that does not match the base view scale it will be scaled randomly. I need a way to isolate the views that do not follow the base view scale so that I can quickly and automatically scale them correctly back to 1:1.

 

I hope that halfway makes sense...

0 Likes
Message 4 of 8

CodeDing
Advisor
Advisor

@Jason.Rugg ,

 

I have a general idea, but not sure where to start. Can you perhaps provide an dwg example of the Inventor exported items? That will help convey to me which items are 1:1 and which ones are not, and  provide insight on how to approach a solution.

0 Likes
Message 5 of 8

Jason.Rugg
Collaborator
Collaborator

@CodeDingSure, I will get a sample put together of a fresh exported ACAD.dwg from Inventor.dwg, as well as a copy of the ACAD.dwg that has had my code run against it and maybe a short video of the code actually doing the conversion.

0 Likes
Message 6 of 8

Jason.Rugg
Collaborator
Collaborator

@CodeDingAttached are two drawing files, a before.dwg and an after.dwg. The before is the fresh export from inventor without anything done to it. The after has had my code run against, as you will see they are very different. The before has everything in paper space and all geometry with the exception of scaled detail views are 1:1. The after splits the drawings into mode/paper space, scales the model space 1:1 with the exception of scaled detail views and scales paper space to a true 1:1 paper size layout. 

 

For now I am unable to do a screen capture but the whole conversion process is only 5 clicks of the mouse. So ideally, this conversion could somehow detect scaled views and scale them to 1:1 and then create the correct viewports in paper space. 

 

Not necessary for now but another thing I would like the code to do is to reassociate all of the dimensions automatically without anymore user input.

 

Hopefully these drawings help, let me know if you need anything else.

Message 7 of 8

CodeDing
Advisor
Advisor

@Jason.Rugg ,

 

Thank you. the dwgs were very useful.

 

The only way I can see this efficiently being accomplished would be by asking the user to select geometry items AND provide the Scale for those items each time. I don't have time to code this atm, but here is the general outline of what could be implemented.

*assuming geometry items in PS*
> select only PS items that will be in 1st VP and moved to MS (so Geometry items, NOT items like dimensions or MText)
>> get VP scale (for the selected items) from user (Ex: 1" ps = 2" ms)
>> calc bounding box around PS geometry items selected
>> create VP in PS with bounding box coords
>> place selected PS geometry items in MS
>> scale new MS items based on user input scale
>> calc new bounding box around MS items scaled
>> back to PS and zoom-window of VP to the MS bounding box around geometry items
>> items in MS are now to scale, and VP in PS is now zoomed to MS objects
> do it again (this will all be nested in a WHILE loop) until user says we're done

Hope that makes sense.

 

Best,

~DD

0 Likes
Message 8 of 8

CodeDing
Advisor
Advisor

@Jason.Rugg ,

 

I ran across this VIEWBASE command (I'm using AutoCAD 2018) and wondered if it related at all to this situation?

 

Just a shot in the dark.

 

Best,

~DD

0 Likes