Using the Resolve Link file dialog from VBA?

Using the Resolve Link file dialog from VBA?

bshbsh
Collaborator Collaborator
309 Views
4 Replies
Message 1 of 5

Using the Resolve Link file dialog from VBA?

bshbsh
Collaborator
Collaborator

Hey guys,

does anyone know how to call/use the resolve link file dialog programmatically?

I'm using a plain file open dialog but it has so many bugs and disadvantages...

0 Likes
310 Views
4 Replies
Replies (4)
Message 2 of 5

WCrihfield
Mentor
Mentor

Hi @bshbsh.  I think you may be looking for this method:

DesignProjectManager.ResolveFile 

...but I am not 100% sure.

You can get to that by:

Dim sResolved As String = ThisApplication.DesignProjectManager.ResolveFile(sSourcePath, sDestinationPath)

If this solved your problem, or answered your question, please click ACCEPT SOLUTION .
Or, if this helped you, please click (LIKE or KUDOS) 👍.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 3 of 5

bshbsh
Collaborator
Collaborator

Unfortunatelly this does not seem to provide that dialog.

0 Likes
Message 4 of 5

WCrihfield
Mentor
Mentor

Hi @bshbsh.  We can either try to do stuff entirely by code, or we can try to simulate manual processes which use manual user interface dialogs, but we usually can not interact with those manual user interface dialogs by code, so we have to choose which way we want to go.  If we use the dialogs, then we will likely not have the level of control from a code standpoint that you are expecting.

Anyways, I believe that if you only want to show the dialog, then you can use something like the following line of code, which essentially just executes the command, as if you just clicked a button in the user interface to show it.  But then all control is given to the user interface dialog, instead of the code that launched it.

ThisApplication.CommandManager.ControlDefinitions.Item("UCxResolveFileCmd").Execute

However, if you run this while the active document (showing on your screen at that moment) does not have any unresolved file references in it, it may not show a dialog, and may be waiting for you to select something for it to focus on.  I have never tried to use it this way though, so I do not know if it will help you.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 5 of 5

bshbsh
Collaborator
Collaborator

that doesn't work, I am resolving files by code before they are even opened (with fileevents). I just need a dialog as a last resort if the code can not resolve the file location by itself and needs user input. I just use a standard file dialog, but it is buggy and does not have all the infos that a resolve file dialog would have. I just wanted to use that if possible, but if not, then it stays with the standard dialog.

0 Likes