Skip to Content
0

Can i open a Model Read Only from script in Powerdesigner?

Mar 17, 2017 at 05:42 PM

111

avatar image

I know how to open a model in Powerdesigner from script.

The problem is that i want to open a model Read Only and i can't find the right method or option for that.

Is it possible to open a Powerdesigner model Read Only from script?

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

4 Answers

George McGeachie Mar 20, 2017 at 10:22 AM
0

In the metamodel help, there are only two options for OpenModel:

omf_DontOpenView    : Don't open default diagram's view.
omf_Hidden : Don't let model appear in workspace.

So it doesn't look like you can open a model read-only. Just make sure you don't save the model :)

Share
10 |10000 characters needed characters left characters exceeded
Phillip Lam
Mar 20, 2017 at 07:04 PM
0

Try this:

Before open the model, in your script, add command

attrib +R <path>\ <mode name>

This command sets the model to Readonly.

When you make change to the model and want to save the change you will get error.

Share
10 |10000 characters needed characters left characters exceeded
Rob Vonk Mar 22, 2017 at 10:25 AM
0

Thanks for the answers. I already changed them to read-only on operating system level so acidentally saving is not the problem.

The problem is that i get a message saying that the model is write protected and i have to confirm opening it.

There's a menu option to read-only open the model so i hoped that the same was possible from a script.

Share
10 |10000 characters needed characters left characters exceeded
Phillip Lam
Mar 23, 2017 at 02:11 AM
0

Before open the model, you can set

InteractiveMode = im_Batch

This will force dialog doesn't show up.
Share
10 |10000 characters needed characters left characters exceeded