Announcements

The Autodesk Community Forums has a new look. Read more about what's changed on the Community Announcements board.

Options to Automate the creation of data rich DWFs (AS 2017)

Anonymous

Options to Automate the creation of data rich DWFs (AS 2017)

Anonymous
Not applicable

I am quite discouraged on the automation abilities to batch/bulk process CSA models into data rich DWF files that can be used within Navisworks. I thought having to script / deal with popups / call upon nwcout in a previous app for Prosteel + AutoPlant was painful.... automating Advanced Steel is much worse.

 

The ask:

What is the easiest method to automate the generation of / export to Navisworks supported files and retain the data? 

 

What I Have Tired:

Automating the generation of NWDs/NWCs en masse and at a high clip (I have NWDs generating as fast as their DWGs are being updated) via using the Navisworks API that calls upon roamer to process the files. When it comes to Advanced Steel models, I was hoping that with the proper object enabler installed that I could simply open the DWG within Simulate and export to NWD/C/DWF and have a data rich model. Not the case. I am not even able to see anything?! So I tried:

 

1: using AcCoreConsole (the preferred method to automate a headless AutoCAD), and and issue the 3ddwf command for each DWG. This didn't seem to produce anything, and I got an occasional crash of AcCoreConsole.. so I abandoned this approach..

 

2: attempt to automate the batch calling of the  3ddwf command for a number of DWGs that are opened/closed via scr file passed into an instance of AdvancedSteelLauncher.exe. So this can work, but because the 3ddwf command seems to always throw open the :Export 3D DWF" dialog, (seems to be no way to suppress.. and this seems to be the reason that the AcCoreConsole approach failed), one must rely on coding a bunch of window manipulation  / closing code and/or leverage a 3rd party tool such as AutoIt. This is an extremely fragile approach and I'm hoping there is a better way.

 

Questions:

1: is there any way to perhaps use the AS API and export to Navisworks that way? I.e.: is it possible to call the 3ddwf command from within the api? Hopefully that would allow for a much less UI dependent interaction and the API would allow me to open/save to DWF? I can't find API documentation that makes this clear to me.. 

 

2: If #1 above isn't possible, is there a way to suppress the Export 3D DWF dialog? Setting filedia / cmddia to 0 has no affect on this and thus requiring the use of an UI automation tool to "fill in the blanks" that can't be done via scr, AND handle any error dialogs that should arise. 

 

3: if #2 isn't possible, what options are left? 

 

Bonus: how does the Export To Navisworks button in the Export & Import tab of the ribbon seemingly creates a DWF and automatically launches Navisworks silently? How can we do the same?

 

If anyone can point me in the right direction, that would be greatly appreciated. 

0 Likes
Reply
Accepted solutions (1)
939 Views
3 Replies
Replies (3)

Anonymous
Not applicable
Accepted solution

Hi,

 

https://knowledge.autodesk.com/support/autocad/troubleshooting/caas/sfdcarticles/sfdcarticles/Publis...

 

"You can publish 3DDWF without the use of dialogs by setting FILEDIA to 0 and command EXPORT. Enter file name followed by .DWF as extension.

Tip submitted by:

Chin-Wee Ong
Autodesk"

 

You can use command reactors to automatize the export :

 

<CommandMethod("AddEvents")>
        Public Sub AdvanceSteelEvents()
            'To avoid ambiguity, we have to use the full type here.
            Dim Doc As Autodesk.AutoCAD.ApplicationServices.Document = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument
            Dim db As Database = HostApplicationServices.WorkingDatabase()
            'AddHandler db.ObjectOpenedForModify, New ObjectEventHandler(AddressOf objOpenedForMod)
            AddHandler doc.CommandWillStart, New CommandEventHandler(AddressOf cmdWillStart)
            'AddHandler doc.CommandEnded, New CommandEventHandler(AddressOf cmdEnded)

        End Sub

        Public Sub cmdWillStart(ByVal o As Object, ByVal e As CommandEventArgs)
            Dim Doc As Autodesk.AutoCAD.ApplicationServices.Document = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument
            Dim ed As Editor = Doc.Editor
            Try
                If e.GlobalCommandName = "HERE THE NAME OF THE EXPORT TRIGGER COMMAND : exemple QSAVE" Then
                    'here your export proc : set export file name set filedia to 0, export, set filedia to 1 ,etc.
'or directly use the api to export.


End If
Catch ex As System.Exception 'removed error report bacause of pesky eLock message 'ed.WriteMessage("Error in cmdWillStart: " + ex.Message) End Try End Sub

 

You can directly export to 3DDWF whit autocad API, see here by  Gilles Chanteau

http://www.theswamp.org/index.php?topic=31897.msg474069#msg474069

 

 

 

make your DLL and load it with lysp at startup:

 

(command "netload" "D:\\Autocad\\LYSP\\AddInATQVB.dll");
(command "AddEvents");

 

Regard's

dgorsman
Consultant
Consultant

That might be a bit of overkill - the AUTOPUBLISH feature in AutoCAD can create both PDFs and DWFs.  Haven't tested it with 3D DWF though.  And there's the PUBLISH command, which has the option for 3D DWF.

----------------------------------
If you are going to fly by the seat of your pants, expect friction burns.
"I don't know" is the beginning of knowledge, not the end.


0 Likes

Anonymous
Not applicable

Excellent info! Thanks!

 

That export command will allow me to tackle this nicely from a scr, and not really have to create a plugin. Any thoughts on how this could be done with accoreconsole? i get an occasional crash when I try to operations with an AS DWG loaded. I'm not sure if there is a specific /product code I need to supply accoreconsole as an arg.. but no luck this far.

0 Likes