AnsweredAssumed Answered

Passing Datacard variables to Tasks Add-in for DWG-files

Question asked by Kees Kuijt on Dec 15, 2011
Latest reply on Jan 6, 2012 by Jeff Sweeney



I want to convert a .DWG to PDF and I want to initiate via a menu-command. So I tried it with the basic Convert-option but the problem is that Solidworks by default uses Inches and my drawings are in mm. This I correct by using Advanced Script Options and inserted the next code:



        'Manual code to force use of MM

        Set importData = swApp.GetImportFileData(docFileName)

        importData.LengthUnit("") = SwConst.swLengthUnit_e.swMM




This works fine.


However, now I need to use the scale as well, and the scale isn't constant so I need to read the scale from the DWG-file (it is in the title-block, named "SCHAAL") or I need to fetch it from the datacard since this value/card variable is already filled during bulk check-in.

I don't know how to read the variable from the datacard or directly from the DWG-file.


As soon as I know this I can also fetch the paper-size since Solidworks doesn't handle it correctly if it is done automatically.


Someone please help?


Kind regards,