jmplonka / InventorLoader

Workbench for FreeCAD to loads or import Autodesk (R) Inventor (R) files.
GNU General Public License v2.0
119 stars 17 forks source link

Some questions about how plugin works #19

Closed nicedayvl closed 6 years ago

nicedayvl commented 6 years ago

Hi, could you tell me please how plugin works? Where are the dots, lines and other primitives imported in from what stream are they read and where are they resides in python code. Basically i would like to help with development of the greate plugin but need some info on plugin design. Thanks in advance.

jmplonka commented 6 years ago

Thank you for the compliment. I worried, that one day someone will come to get some information about how the plugin is working ,> Please give me some time, so that I can write some documentation in the Wiki. Till than I will try to give you a short Sketch about the structure... please be patient, I will write you soon.

jmplonka commented 6 years ago

I just updated the FileFormat.odt in DOCU

jmplonka commented 6 years ago

And now the first draft of the workflow... Can you please give me your feedback about what has to be explained more detailed?

Anyhow: please have a look in the generated files. You will find them in a sub-folder with the same name of the Inventor file (e.g. MyDevelopment.ipt =>

nicedayvl commented 6 years ago

Greate job, much appreciated! I will look at this all and write back soon.

nicedayvl commented 6 years ago

Could you explain please more in details how buffer format of Point2D, Circle2D, Line2D, etc primitives And what exactly procedure like does:

def ReadSketch2DEntityHeader(self, node, typeName):
    node.typeName = typeName
    i = self.ReadHeadersss2S16s(node)
    i = node.ReadCrossRef(i, 'refSketch')
    return I

what does ReadHeadersss2S16s exactly?

jmplonka commented 6 years ago

Well, ReadHeadersss2S16s is a structure at the beginning of many section nodes. Most sections have a UInt32 + UInt16 'main' header (dont't know anything about the meaning). Inventor before 2011 stores additionaly the size from time to time. For the 'main' header this is 0x00000006 (4 Bytes for an UInt32 + 2 Byte for the UInt16).

Content-Header 2S16S(ReadHeadersss2S16s)

Content-Header 3S (ReadCntHdr3S)

Content-Header (ReadContentHeader):

Most of the Read_abcdefgh in importerDC.py: Read_90874D11(self, node): node.typeName = 'Sketch2D' correspond with a Create_[TYPE_NAME] in importerFreeCAD.py: Create_Sketch2D(self, node):

BTW: I use Visusl Studio for the development.