Custom Interface Control Document

MagicDraw OpenAPI, scripting related questions and discussions

Moderator: Moderators

Custom Interface Control Document

Postby Patzz0r » Fri May 24, 2019 12:33 pm

Good Afternoon,

I am looking to create a custom report template that outlines internal interfaces (IE connectors and their pins). I created the diagrams but am having trouble understanding how to create the custom template for the element items I need. I know I need to use $foreach to recursively grab all the elements in the package. In my IBD I need the following elements from the Part Properties:

1. Name (In the general Specification table)
2. Type (In the general Specification table)
3. Connectors (This is the Connectors section of the Part Property
3. Applied Stereotype (I created a custom stereotype called "connector")
4. Inner Element --> Body (This is the description of the connector)
5. Inner Element --> Image (Image of the mechanical drawing of the connector.

I also made a package called "Connector Information" and I believe I need to use that as my Scope.

I appreciate any help!
Patzz0r
Forum Newbie
Forum Newbie
 
Posts: 7
Posts Rating:0
Joined: Fri May 24, 2019 12:20 pm

Re: Custom Interface Control Document

Postby Patzz0r » Wed May 29, 2019 12:28 pm

After a bit of scouring the internet and trial and error I came up with this code. However I am only getting the diagram name and picture to come up. So basically the first 4 lines of code work:

Code: Select all
#foreach ($diagram in $Diagram)
#if ($diagram.diagramType == “SysML Internal Block Diagram”)
$diagram.name
$diagram.image
#foreach ($pp in $report.filterElement($b.ownedAttribute, [“Part Property”]))
Part Name   $pp.name
Part Type   $pp.type
#forrow ($att in $pp.attribute) $att.type.name   $att.name#endrow
Description   $pp.body
Connector Image   $pp.image
Connections   $pp.connectors
#end
#end
#end


I found a post from 2011 about part and value properties but I am only getting the diagram name and picture to come up. Am I calling everything correctly?
Patzz0r
Forum Newbie
Forum Newbie
 
Posts: 7
Posts Rating:0
Joined: Fri May 24, 2019 12:20 pm


Return to Programmatic Extendibility

Who is online

Users browsing this forum: No registered users and 0 guests

cron