I'm developing a routine that opens a file with opendesignfileforprogram. I cannot set a model of this file as active model reference. How can i send a key-in to this design file thru vba?
I need to send the following "reference merge all" and "reference makedirect A.dgn->B.dgn"...
I have implemented copy all elements but it looses clip boundaries...
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
Thank you Jan for your help. OpenDesignFileForProgram is much faster than OpenDesignFile. I was using key-ins because I don't know how to do "reference merge all" and "reference makedirect A.dgn->B.dgn" by direct code. Can anyone point me in the right direction to do this? Regards Rui
rsousa said:OpenDesignFileForProgram is much faster than OpenDesignFile.
It's natural result of fact it's opened in "raw access mode", where direct access from code allowed, but no "user oriented features" (e.g. key-ins, some RasterManager. functionality etc.) are not initialized.
rsousa said:Can anyone point me in the right direction to do this?
In my opinion the simpelst way is to open a design file normally and to use key-ins, because you can be sure it will work exactly the same way as MicroStation. I guess a similar functionality can be implemented in VBA, but to support all scenrios correctly (merging of self attachments or nested references) is not simple task. But if you know your references will be always in some structure, check Attachment object and how to copy from attachment (and using CopyContext) in MicroStation VBA help.
rsousa said:Is it possible to change, thru vba, an attachment from live nesting to copy attachement?
I guess it should be possible, but I assume there is no simple straightforward solution available. I don't know about specific key-in or VBA property or method that can be used to configure an attachment nesting mode.
Because of that, I guess it requires to write own reattachment procedure or to try to "hack" References dialog, because the nesting mode is represented refFileInfoP->settings.nestMode CExpression value, but refFileInfoP has to be set correctly upfront.