I want to print DWG files from Excel VBA to PDF. There is a lot of help for AutoCAD, but little or none found for NanoCAD. I tried using equivalent functions, but results in error.
A little background on what I have explored.
Print configuration DWG2PDF.pc3 created in NanoCAd and the following code :
Dim NCAD As nanocad.Application Dim ndg As nanocad.Document Dim pth As String Dim result As String pth = ThisWorkbook.Path Set NCAD = GetObject("", "nanoCAD.Application") NCAD.Visible = True Set ndg = NCAD.Documents.Open(pth & "\typicals\Title-OPA01.dwg") ndg.ActiveLayout.ConfigName = "DWG2PDF.pc3" result = ndg.Plot.PlotToFile(pth & "\Output\op.pdf")
I used the command specified for autoCAD professional version and not LT. Is there a workaround in AutoCAD LT which I can adapt to NanoCAD?
Second trial through Acrobat's print function which windows calls for printing to PDF. Got help from Internet on calling the Shell command. I used some code as below.
call Shell ("C:\Program Files\Adobe\Acrobat 8.0\Acrobat\Acrobat.exe /p/h" & pth & "\typicals\Title-OPA01.dwg")
Note: I referenced the type library of NanoCAD, Acrobat into the VBA project.