Macro to open file location folder

Macro to open file location folder

dewie125
Participant Participant
3,009 Views
6 Replies
Message 1 of 7

Macro to open file location folder

dewie125
Participant
Participant

Hi Guys.

 

I currently have Autocad LT 2018

 

I am trying to use a macro to open up my file location in explorer. I have seen a few Macro's using "START" or "STARTAPP", but my LT version doesn't support it.

 

I use "AI_startapp".

 

This is how far i came:

 

^C^C_AI_startapp;explorer.exe; $M=$(SUBSTR,$(getvar,Dwgprefix),1);

 

The problem i am facing is that Explorer opens up in "Quick Access". I then have to close it and hit enter in cad again and this will open up the correct folder, but it leaves my location breakdown in my command bar. Please see my attached file.

 

You will find my location of my file below, but keep in mind this location should change. This is why i am using Dwgprefix.

 

Y:\Clients\Active\Cameron ....\141 ....\Drawings\CAD\Sketch Plan\ERF ....

 

Much appreciated.

 

0 Likes
Accepted solutions (1)
3,010 Views
6 Replies
Replies (6)
Message 2 of 7

pendean
Community Legend
Community Legend
Turn off QUICK ACCESS in Windows 10's File Explorer, nothing you can do about it with LT https://www.windowscentral.com/how-remove-quick-access-file-explorer-windows-10
0 Likes
Message 3 of 7

dewie125
Participant
Participant

Thanks for your prompt response Dean.

 

Is there any way i can export the dwgprefix to a text file or any other file?

 

I would then start a cmd app, which reads the dwgprefix and open its destination.

 

I am quite new to Macro, but this would make my life a lot easier.

 

Thanks.

0 Likes
Message 4 of 7

steven-g
Mentor
Mentor
Accepted solution

Would having an attributed block work, the attribute using a field to read the dwgprefix, and then a macro to run attext which gives a txt file output, which you can place in a named location for your cmd file to read

Message 5 of 7

dewie125
Participant
Participant

Hi Steven 

 

This is great! I understand the thought process. This is excellent!

 

The last thing i am currenlty struggling with is the template file.

 

I keep on getting invalid field specification. I have never used ATTEXT.

 

I have created a attribute named: Test

I then added the the field into the value of the block.

I used file path. (It displays perfectly in Model space)

 

The problem i am facing is when doing the ATTEXT command.

 

My current template file is set up like this:

 

BL:NAME CWWW000

 

Yet Autocad Give me the following:

 

 

Command: ATTEXT
** Invalid field specification:
BL:NAME CWWW000

 

I Have tried multiple options.

 

BL:NAME CWWW000

BL:NAME C0080000

BL:NAME C016000

0 Likes
Message 6 of 7

dewie125
Participant
Participant

Hi Guys.

 

I figured it out. I had so blank spaces or lines within my template file, which i had to remove.

 

Everything is running smoothly.

 

Thanks guys for your assists on this topic.

 

I will mark this as solved.

Message 7 of 7

steven-g
Mentor
Mentor

Great glad to hear you have it working.

0 Likes