Skip to Content
avatar image
Former Member

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

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?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Mar 20, 2017 at 10:22 AM

    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 :)

    Add comment
    10|10000 characters needed characters exceeded

  • Mar 20, 2017 at 07:04 PM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Mar 22, 2017 at 10:25 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • Mar 23, 2017 at 02:11 AM

    Before open the model, you can set

    InteractiveMode = im_Batch

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