Quantcast
Channel: PTC Community : Discussion List - All Communities
Viewing all articles
Browse latest Browse all 11348

Export dwg format via vb API

$
0
0

i am trying to export dwg file via VB API

 

here is my code:

 

            Dim model As IpfcModel

            asyncConnection = (New CCpfcAsyncConnection).Connect(Nothing, Nothing, Nothing, Nothing)

            asyncConnection.Session.ChangeDirectory("E:\Export")

            model = asyncConnection.Session.CurrentModel

            If model Is Nothing Then

                Throw New Exception("model not present")

            End If

            Dim dwginstructions As IpfcDWGSetupExportInstructions

            Dim outdir As String

            dwginstructions = (New CCpfcDWGSetupExportInstructions).Create()

            outdir = asyncConnection.Session.GetCurrentDirectory() + model.InstanceName.ToLower + ".dwg"

            model.Export(outdir, dwginstructions)

 

it can export a dwg file, but it is 9 kb, and it is an Invalid graphics file.

 

where am i wrong?

 

could anybody show me another way to do this?


Viewing all articles
Browse latest Browse all 11348

Trending Articles