Author Topic: dwg shortcut on different versions of AutoCAD  (Read 2672 times)

0 Members and 1 Guest are viewing this topic.

dubb

  • Swamp Rat
  • Posts: 1105
dwg shortcut on different versions of AutoCAD
« on: May 21, 2020, 04:46:29 PM »
I want to create a dwg shortcut that executes a script. I can only find examples of Target strings where it needs to contain the exact location of acad.exe

Here is an example of a Target string that works.
Code: [Select]
"C:\Program Files\Autodesk\AutoCAD 2018\acad.exe" /t "\\server\cad\00_Templates\blank.dwg" /b "\\server\cad\10_CAD Support\Scripts\foo-script"
Is there a way to edit the Target string so that I don't need to define the exact location of acad.exe?

I tried this. It didn't work.
Code: [Select]
"\\server\cad\00_Templates\blank.dwg" /b "\\server\cad\10_CAD Support\Scripts\foo-script"

ronjonp

  • Needs a day job
  • Posts: 7526
Re: dwg shortcut on different versions of AutoCAD
« Reply #1 on: May 21, 2020, 05:06:13 PM »
Not exactly sure what you're asking but shouldn't this need the file extension to work?

"\\server\cad\10_CAD Support\Scripts\foo-script.scr"

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

dubb

  • Swamp Rat
  • Posts: 1105
Re: dwg shortcut on different versions of AutoCAD
« Reply #2 on: May 21, 2020, 05:21:18 PM »
Surprisingly it works with or without the .scr file extension.

Not exactly sure what you're asking but shouldn't this need the file extension to work?

"\\server\cad\10_CAD Support\Scripts\foo-script.scr"

I was thinking about adding a cmd string to access the registry to get the default acad.exe directory followed by
Code: [Select]
/t "\\server\cad\00_Templates\blank.dwg" /b "\\server\cad\10_CAD Support\Scripts\foo-script"

dubb

  • Swamp Rat
  • Posts: 1105
Re: dwg shortcut on different versions of AutoCAD
« Reply #3 on: May 21, 2020, 07:07:33 PM »
I tried loading the script using "command script". Still doesn't work.

Code: [Select]
"\\server\cad\00_Templates\blank.dwg" (command "SCRIPT" "\\\\server\\cad\\10_CAD Support\\Scripts\\foo-script.scr")

ronjonp

  • Needs a day job
  • Posts: 7526
Re: dwg shortcut on different versions of AutoCAD
« Reply #4 on: May 22, 2020, 12:09:21 AM »
Are you adding this to the autocad shortcut? Not sure where you're going with the command ?

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

dubb

  • Swamp Rat
  • Posts: 1105
Re: dwg shortcut on different versions of AutoCAD
« Reply #5 on: May 22, 2020, 01:10:48 PM »
Are you adding this to the autocad shortcut? Not sure where you're going with the command ?
Its a shortcut for a dwg file. Not a shortcut for the autocad program itself.

BIGAL

  • Swamp Rat
  • Posts: 1396
  • 40 + years of using Autocad
A man who never made a mistake never made anything