Quantcast
Channel: MicroStation Programming Forum - Recent Threads
Viewing all articles
Browse latest Browse all 7260

RE: Using a MACRO to change specific reference file logical names

$
0
0

Hi Taylor,

[quote user="Taylor Brownlow"]I was wondering if it's possible to change reference file logical names using a MACRO for instance:[/quote]

I agree with Chuck and Jon, what you are asking about should be possible. And as Chuck wrote, how to change an attachment logical name has been discussed several times in forums.

What is not good you did not mentioned what product (can be MicroStation, but also PowerDraft or Bentley Navigator etc.) and version do you use. Also it's not clear what do you mean by "MACRO". If talking about MicroStation V8i, old MicroStation BASIC is available (obsolete, don't use it!) and MicroStation VBA (recommended and available also in MicroStation CONNECT Edition).

[quote user="Taylor Brownlow"]I have reference files in a master file named 12345drng.dgn, 12345reqd.dgn and I need to have something that will go to each files properties and change the logical name to DRNG and REQD[/quote]

Jon mentioned a pseudocode process, but it's not clear how the rules are defined exactly. Is it about to remove (strip) all numbers from a file name beginning and the remaining part to change to uppercase? It's not possible to code anything until the resuts will be clear. VBA is not very good in working with strings, but such processing is simple enough to be implemented.

[quote user="Taylor Brownlow"]I tried recording a MACRO of clicking references[/quote]

This is not a good way. The macro recorder is quite limited tool and is mostly oriented to "script like" process how is run by a user, but rarely it creates a correct code when interacting with more complex objects. And when modal dialogs are involved in the recording, it does not work at all usually. The right way is to write the code manually.

[quote user="Taylor Brownlow"]Is there something similar to "reference properties" i can use that uses a portion of the file name like "drng" instead?[/quote]

The most of reference attachment properties is accessible as properties and methods of Attachment object. See MicroStation VBA help file for more details.

With regards,

  Jan


Viewing all articles
Browse latest Browse all 7260

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>