cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X

[Integrity Modeler] How to create a block property, assing a stereotype and adopt the style via script.

sdachgruber
1-Newbie

[Integrity Modeler] How to create a block property, assing a stereotype and adopt the style via script.

Hello community,

I actually have this piece of code as a toolbar script (SysML-Profile used):

Option Explicit

Function ValidInsertionPoint()

    ValidInsertionPoint=True

End Function

Function SelectObject()

    SelectObject=False

    Script.AddResultObject SysML::BlockProperty

    msgbox NewSymbol

    SelectObject=True

End Function

Function OnFinished()

    dim NewClass   

    set NewClass = NewSymbol.Item("Dict Item")

    dim NewClass1

    set NewClass1 = NewClass.Item("Class")

    msgbox NewClass1

    call NewClass.Add("Stereotype", mBlockProperty)

    call NewClass1.Add("Stereotype",mBlock)

    msgbox NewSymbol

    OnFinished=True

End Function

With that I've got 2 problems:

  • The created item is of type "Role", not of Type "BlockProperty". How can I change this?
  • The stereotype is assigned, but the style is still not adopted, even though I have the checkbox "Apply to New Symbols" checked.

Can anybody help me?

Thanks a lot and best regards,

Markus

0 REPLIES 0
Announcements


Top Tags