Run multiple /acmd from outside of DOpus?

Hi,

Just wondering if it is possible to issue multiple /acmd to DOpus, from outside of DOpus - with a single external command?

I've seen the thread here... [url]Sending multiple commands with 'dopusrt.exe /cmd']... which mentions using multiple /acmd calls, one for each command. But I can't seem to get it to work.

My goal is to open a new lister from AutoCAD, to a directory based on the current ACAD drawing's directory, then set a preset folder format & flatview mode.

So... Ive got:

(startapp "C:/Program Files/GPSoftware/Directory Opus/dopusrt.exe" "/acmd Go NEW=nodual  \"T:\\Path with spaces\"")

Which will bring the new lister to the top of the active window, at the specified directory.

I then try to run:

(startapp "C:/Program Files/GPSoftware/Directory Opus/dopusrt.exe /acmd Set FORMAT=DWGColumns")

Which is ineffective (I believe because the new lister is now active, so ACAD cannot send this command to DOpus.

One suggested solution from another thread was to create a DOpus internal command, and call on that from the external program (ACAD in this case). Unfortunately this won't work (I think) because the directory path is a variable. Unless there is a way to pass a variable to an internal DOpus command, from outside of DOpus.

Sorry if my explanation makes no sense, I tried to be as concise as possible.

Thanks a lot for any help.

Alternatively, if I run:

(startapp "C:/Program Files/GPSoftware/Directory Opus/dopusrt.exe" "/acmd Go \"T:\\Path with spaces\"")

The existing (maybe LASTACTIVE) lister will go the the specified directory, then I can run:

(startapp "C:/Program Files/GPSoftware/Directory Opus/dopusrt.exe /acmd Set FORMAT=DWGColumns")

to set the folder format, but I then have to manually bring the lister to the front of Windows.

The above only works as described if there is already a DOpus lister open, if no existing lister is open, then new lister will be brought to the top of Windows and the column format code will not act on the lister.

A user-defined command is probably the way to go (unless you want to make a script add-in, which can also add commands).

User-defined commands can take arguments, and how to use them is shown in the 2nd half of the page I've linked.

Another alternative is to configure the relevant folders to always show the DWG columns, if you always want to see those columns in those folders. You may be able to use a wildcard format to match all of the folders in one fell swoop, depending on how they are organised. Then you would not need to open them in any special way.

Thanks for the reply Leo.

I would still like the default folder/column format for these folders to be "standard". So it looks like passing the 'directory' to a user-defined command, as an argument, could be a good option.

So the DOpus user-command would be something like:
Command name: DOpus_Explore

Go &ACADPATH& Set FORMAT=DWGColumns

And the command call from within ACAD would be:

(startapp "C:/Program Files/GPSoftware/Directory Opus/dopusrt.exe" "/acmd DOpus_Explore \"T:\\Path with spaces\"")

Looks like it could definitely be the way to go, if my understanding is correct.

Thanks for suggesting that, I will test it out in the morning.

I just gave it a quick test (I have added the ACADPATH argument to the user-command's template field), and it seems to work well - only for directory paths with no spaces.

This could be that I just haven't quite got the syntax correct for the ACAD code, but I'm not 100% sure.

Is there anything else that I should be doing to enable the use of paths with spaces?

Go "&ACADPATH&" would be my guess.

Thanks for the reply Leo, that seems to have done the trick.

I was trying to crack-the-nut of including the extra double quotes in the argument (passed from ACAD), it never occurred to me to stick them into the DOpus command - thanks for the tip.

I've managed to get that first part of the code to work well. When I say "first part" I am refering to having DOpus open a new lister at the specified path.

I am now trying to set the folder format and flatview mode, please see my code below:

Go NEW=nodual "&ACADPATH&" Set FORMAT=DWGColumns Set FLATVIEW=MixedNoFolders

There is a bit of variety with what this code does...

If a DOpus lister is already open, the code will open a new lister at the specified path, but will apply the folder format & flatview style to the existing (already open) lister. How would you recommend I fix that?

If a DOpus lister is NOT already open, the code will open a new lister at the specified path, and will apply the folder format & flatview style. But, the folder format will be a hybrid of the default folder format & the custom one (DWGColumns). Please see screenshot below.


Note that the Size, Type, Modified, Owner & Location columns should not be showing.

I am able to resolve this by using the code below:

Go NEW=nodual "&ACADPATH&" Set FORMAT=DWGColumns Set FLATVIEW=MixedNoFolders Set FORMAT=DWGColumns

... Is there a better (more elegant) way to correct this?

Thanks a lot for your ongoing support Leo.

Ps: I am using DOpus beta 12.0.8 - so I'm not sure if any of the above issues could simply by symptoms of the beta version?

This should do what you want:

Go NEW=nodual "&ACADPATH&" [ Set FORMAT=DWGColumns Set FLATVIEW=MixedNoFolders Set FORMAT=DWGColumns ]

Embedded Functions explains what it's doing. Essentially, the bit in square brackets is sent to the new window instead of the current window.

Ah awesome, thanks a lot for the Leo.

Embedded functions was the key, makes perfect sense.

I've managed to get the 2 commands to work well together so far (limited testing).

Code below for future reference:
ACAD

(setq #PATH (strcat (vl-filename-directory (getvar "DWGPREFIX")) "\\Drawings")) (startapp "C:/Program Files/GPSoftware/Directory Opus/dopusrt.exe" (strcat "/acmd DOpus_Explore \"" #PATH "\""))

DOpus

Go NEW=nodual "&ACADPATH&" [ Set FORMAT=DWGColumns Set FLATVIEW=MixedNoFolders Set FORMAT=DWGColumns ]

Thanks a lot for the ongoing help Leo.

Hi again,

I've been looking into including the 'status icon' column (with label assignment filters based on folder).

The issue I am having is that when I enable the 'status icon' column in the 'Folder Format' preset... I get a duplicate file listing. All files are shown twice.


This appears to be an issue with FLATVIEW. Files not in a sub-folder of the Drawings folder will not be duplicated.

If I refresh the display, the issue is corrected and all files are shown once. Is there a way to write a 'refresh' call into the user command? Is there a better solution?

I'm using DOpus beta 12.0.8.

Thanks for any help.

-------EDIT-------

after further testing, it appears the the presence of the 'status' column is not affecting the duplicate file listing.

Sorry for the confusion. It seems it is FLATVIEW that could be the culprit.

Any suggestions on how to fix this would be greatly appreciated.

What does the Full Path column show for those files?

Hi Leo,

Thanks for the reply.

The 'Full Path' column shows the same value for the duplicate files, in this case it is:

T:\1126 - Huonville\Drawings\Issued for Approval\1125-BD1001_A.dwg

I've also just found that this behaviour seems to be affected by the directory at which the most recently closed lister was pointed to. Please see GIF below for demonstration.

In summary... If the last closed lister was showing the Drawings folder with formatting applied - when the next lister is opened... no duplicates.

If the last closed lister was showing another folder - when the next lister is opened... duplicates.


Can you please include the full path column in your screenshot?

Hi Jon,

Please see below:


All files shown duplicated except those not in a sub-folder of the Drawings folder.

Thanks for the reply.

Thanks! What does your ODD command run?

ODD runs a LISP routine that passes a directory variable/argument to a DOpus user command. Summarised in post #9 of this thread, from the 13th July.

Thanks for the additional information! I've been able to reproduce this and we will have a fix for it in the next beta.

Awesome, thanks a lot Jon.