DesignCAD 3D Max 2027 box
Now available

DesignCAD 2027

Hatches that follow their boundaries, an on-screen dial to turn your model, and a way to find any command by name, in a clean Windows 11 look.

Set file location for drawing with macro

Started by landonairey, August 08, 2013, 07:30:28 AM

Previous topic - Next topic

0 Members and 0 Guests are viewing this topic.

landonairey

Hi there,

    I'm wondering if anyone knows how to set the file location for opening drawings with a macro. I do not want to change the files locations of anything else. I've looked in my help pdf's and sys() / sys$() lists but couldn't dig up anything. Here's why I'm interested:

    I have a bunch of drawings (drawing_1, drawing_2, drawing_3...) in a directory (directory_1). And I have another set of drawings (drawing_a, drawing_b, drawing_c) in directory_A. Say I have one of drawings in directory_1 currently open. One of my macros uses the open command to work with a different set of files (from directory_A) and then ultimately closes out of that file and leaves you at the original drawing (from directory_1) you had open. All of this works fine except now whenever I go to open a drawing from the same project as the original drawing (from directory_1), the open window is pointing towards files in directory_A. It's a waste of time to manually navigate back to directory_1 to open a drawing from the same project. I want my macro to read in the current file location for the "drawing" designation and after using the open command, set the file location for the "drawing" designation back to the original.

Make sense? I hope that was clear!

Bob P

Look at the sys$(2-20) functions to store, change and restore your path.  Personally, I open files from my file manager (Total Commander, which stays open all the time) rather than use DC's file-open.

2 - Current drawing name (with full path) (read_only). 
Contains an empty string until the drawing has been saved at least once.
3 - Current drawing name (minus path) (read_only). 
Contains an empty string until the drawing has been saved at least once.
5 - Current drive (read_only)
6 - Current path name
7 - Current time (read_only)
8 - Current date (read_only)
20 - Default drawing directory
Terminate the desired directory with a backslash '\'. Example:
Sys(20) = "C:\Program Files\IMSI\DesignCAD 3D Max 14\My Drawings\"

landonairey

How did I not see that in the sys$() list! ... time for that cup of coffee I reckon.

Thank you, this is what I need.