Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: adepreter on August 15, 2011, 09:45:44 pm

Title: Custom vs default shape rendering in diagram
Post by: adepreter on August 15, 2011, 09:45:44 pm
Hello,
Does anybody know how to disable Shape Scripts based on some diagram property or custom tag?

Basic Requirement
- Context: a specific diagram
- Default behavior: Shapes are rendered following shape scripts associated with stereotypes.
- Alternative behavior (when a diagram property or custom tag is set to X): Default shape rendering is applied; Shape scripts are ignored


Solutions that we are trying to select custom or default shape rendering in a diagram
1.      Use existing diagram option in the core Sparx product
      Problem: Option not found; no documentation found

2.      Access existing diagram properties from Shape Script
      Problem: How to access current diagram properties in a Shape Script? No documentation found

3.      Define custom diagram tags and access these from Shape Scripts
      Problem: No documentation found

Thanks

Alain
Title: Re: Custom vs default shape rendering in diagram
Post by: KP on August 16, 2011, 08:52:10 am
Quote
Does anybody know how to disable Shape Scripts based on some diagram property or custom tag?
There is a shape script command: drawNativeShape()

Quote
How to access current diagram properties in a Shape Script? No documentation found
On this page (http://www.sparxsystems.com/enterprise_architect_user_guide/9.0/standard_uml_models/displaying_element_properties.html) there is a list of properties you can test against in shape scripts. Look at those beginning "diagram."
Title: Re: Custom vs default shape rendering in diagram
Post by: adepreter on August 16, 2011, 04:40:20 pm
Good. So I will set a stereotype value on the diagram and access the value  in the Shape Script to decide about what is to be displayed.

Thank you for the useful input.

Alain