Results 1 to 6 of 6

Thread: Script to export DWG to NWD path issue

  1. #1
    Active Member
    Join Date
    2007-08
    Posts
    81

    Default Script to export DWG to NWD path issue

    I need help writing a script to export DWG to NWD (NavisWorks). I need to set a path, the NWD is going all over the place when it saves. So far I got:
    ;prevent dialog box
    filedia
    0
    ;nwdout
    nwdout

    ;allow dialog box
    filedia
    1
    ;end

    I don't know how to predefine the path or add the path to the file name at the prompt (would like to use DWG's path):
    Command: nwdout
    File name <filename.nwd>:

  2. #2
    Active Member
    Join Date
    2007-08
    Posts
    81

    Default Re: Script to export DWG to NWD path issue

    Anyone got a suggestion?

  3. #3
    Administrator RobertB's Avatar
    Join Date
    2001-08
    Location
    Dallas TX USA
    Posts
    5,825

    Default Re: Script to export DWG to NWD path issue

    It depends on if the ARX command will accept AutoLISP statements:
    Code:
    (strcat (getvar 'DwgPrefix) (vl-filename-base (getvar 'DwgName)))
    R. Robert Bell
    Design Technology Manager
    S P A R L I N G
    Opinions expressed are mine alone and do not reflect the views of Sparling.

  4. #4
    Active Member
    Join Date
    2007-08
    Posts
    81

    Default Re: Script to export DWG to NWD path issue

    I couldn't get that to work, I think I am doing it wrong.

    I was able to take the text the code generated "C:\\Temp\\Test" and past it at
    Command: nwdout -- File name <test.nwd>:C:\\Temp\\Test
    and the define path worked. Just need to know a way to take "<test.nwd>" part and added it to the path so it will work as a script for multiple files. I have tried using <>, but that doesn't work.

  5. #5
    Administrator RobertB's Avatar
    Join Date
    2001-08
    Location
    Dallas TX USA
    Posts
    5,825

    Default Re: Script to export DWG to NWD path issue

    If the ".nwd" is required this provides it:
    Code:
    (strcat (getvar 'DwgPrefix) (vl-filename-base (getvar 'DwgName)) ".nwd")
    R. Robert Bell
    Design Technology Manager
    S P A R L I N G
    Opinions expressed are mine alone and do not reflect the views of Sparling.

  6. #6
    Active Member
    Join Date
    2008-08
    Posts
    55

    Default Re: Script to export DWG to NWD path issue

    Robert was right on the money with that lisp string, but as a side note you could even tell autocad to automatically open the file in navis as well using the "Start" command. How it would work from a script I don't know, but this is how I currently do it in lisp.
    (command "start" File_Path_as_String)

    an additional bit of info would be that the start command seems to work just like start->run does on windows.... meaning you can open the windows calculator just by typing start and then calc from within autocad

Similar Threads

  1. Open dwg via script using relative path.
    By ryan_22283391556 in forum AutoCAD General
    Replies: 8
    Last Post: 2011-04-07, 04:08 AM
  2. Automate export SDF script trouble
    By mcdonough.80 in forum AutoCAD Map 3D - Import/Export
    Replies: 0
    Last Post: 2010-11-05, 02:32 PM
  3. Revit Export Issue: Failed to Export Image
    By amax_design in forum Revit Architecture - General
    Replies: 1
    Last Post: 2009-11-30, 02:13 PM
  4. GERVAR for drawing path for script SAVEAS?
    By ahefner in forum AutoCAD Customization
    Replies: 15
    Last Post: 2007-06-19, 08:31 PM
  5. Add Support Path via command line or script?
    By stilesj in forum AutoCAD Customization
    Replies: 2
    Last Post: 2006-10-10, 08:14 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •