Programatically Export DWG to IGS in 2016?

Programatically Export DWG to IGS in 2016?

mtwohig
Contributor Contributor
1,239 Views
4 Replies
Message 1 of 5

Programatically Export DWG to IGS in 2016?

mtwohig
Contributor
Contributor

Is there any way to programatically export a DWG to IGS? We have AutoCAD 2016 and I'm developing in VB.Net.

 

I've seen a couple other article using older Acad versions and Aruba.exe, but they didnt work for me... namely because Aruba.exe apparently doesnt come with Acad 2016.

 

0 Likes
Accepted solutions (1)
1,240 Views
4 Replies
Replies (4)
Message 2 of 5

FRFR1426
Collaborator
Collaborator
Accepted solution

aruba.exe has been replaced by acTranslators.exe. Here is some code for 2014/2015:

 

Dim cultureName As String = Thread.CurrentThread.CurrentCulture.Name
Dim acadVersion As String = HostApplicationServices.Current.releaseMarketVersion & ".0.0.F"
#If ACAD2014 Then
  Const PRODUCT_KEY As String = "001F1"
#ElseIf ACAD2015 Then
  Const PRODUCT_KEY As String = "001G1"
#End If
Dim licenseTypeAsString As String = "SA" ' Stand Alone
Dim productGlobalRootKey As String = HostApplicationServices.Current.MachineRegistryProductRootKey.Substring(0, _
  HostApplicationServices.Current.MachineRegistryProductRootKey.Length - 4)
Dim licenseTypeAsInt As Integer = Microsoft.Win32.Registry.GetValue("HKEY_LOCAL_MACHINE\" & productGlobalRootKey & "AdlM", "Type", 2)
' 1 - Network
' 2 - Standalone
' 3 - Multiseat Standalone
If licenseTypeAsInt = 1 Then
    Dim acadLocation As String = Microsoft.Win32.Registry.GetValue("HKEY_LOCAL_MACHINE\" & _
      HostApplicationServices.Current.MachineRegistryProductRootKey, "AcadLocation", "")
    If "" = acadLocation Then
        Throw New ApplicationException("Read of acad location failed")
    End If
    licenseTypeAsString = "NW -productLicensePath """ & acadLocation & """"
End If

Dim startInfo As New ProcessStartInfo(translatorFullPath, String.Format("-productKey {0} -productVersion {1} -productLicenseType {2}" & _
  " -productResourcePath ""{3}"" -productLicenseLocale {4} -i ""{5}"" -o ""{6}""", PRODUCT_KEY, acadVersion, licenseTypeAsString, _
  Path.Combine(acadDir, "AdlmRes\" & cultureName), cultureName.Replace("-", "_"), inputFullPath, outputFullPath))
startInfo.CreateNoWindow = True
startInfo.RedirectStandardOutput = True
startInfo.UseShellExecute = False

Dim proc As Process
Try
    proc = Process.Start(startInfo)
Catch ex As Win32Exception
  If ex.ErrorCode = &H80004005 Then
    Throw New ApplicationException(String.Format("Program {0} not found.", translatorFullPath))
  Else
    Throw
  End If
End Try

proc.WaitForExit()

Dim errors As String = proc.StandardOutput.ReadToEnd()

If Not String.IsNullOrEmpty(errors) Then
  Throw New ApplicationException(errors)
End If

If proc.ExitCode <> 0 Then
  Throw New ApplicationException(String.Format(Extension.StringResources("ImportFailed"), inputFullPath))
End If

 

Maxence DELANNOY
Manager
Add-ins development for Autodesk software products
http://wiip.fr
Message 3 of 5

mtwohig
Contributor
Contributor

Thank you, sir.

 

I will try this when I get a chance... hopefully by tomorrow night.

 

0 Likes
Message 4 of 5

Anonymous
Not applicable

hi

0 Likes
Message 5 of 5

Anonymous
Not applicable

I am having a problem like above but i read your cmt i don't understand

Can you give me the code of a program that outputs the igs file from the dwg file?

I thank you very much

0 Likes