cancel
Showing results for 
Search instead for 
Did you mean: 

VB function behind Import Image ...

former_member217396
Participant
0 Kudos

Hi,

does someone knows, which VB function is used if you select Edit -> Import Image?

I need to add some images to a diagram but in a script.

Regards,

Rafal

Accepted Solutions (1)

Accepted Solutions (1)

former_member185199
Contributor
0 Kudos


I coulnd´t find anything in the help either in the objectdokumentation and i dont think this is vbcode behind this menupoint

former_member217396
Participant
0 Kudos

That's why I asked this question

So does someone have an idea how to add a graphic to a diagram in a script?

former_member185199
Contributor
0 Kudos

sorry i answerd in the other thread !

Create a SolidSymbol ( a diagramsymbol is derived form it so you can use diagramsymbol) and set the property CustomPictureFile or BackgroundpictureFile:

CustomPictureFile As String

Get or set Custom Picture File. A file storing a picture to use as custom
shape. This picture file can target an image in the picture library using a
specific syntax. For instance: "piclib://Enterprise
Architecture.piclib#Business\Balance.png".

BackgroundPictureFile As String

Get or set Background Picture File. The file path of the picture to use for
background drawing.

hth

Message was edited by: dirk jaeckel

Answers (1)

Answers (1)

former_member185199
Contributor
0 Kudos

having this:

using this:

dim d : For each d in activemodel.AllDiagrams

     If d.Name = "Main" then

        dim dia : Set dia = d

        output dia

        dim s : for each s in dia.symbols

      

            if s.iskindof(cls_solidsymbol) then

             output s

                s.CustomPictureType = 3

                s.BackgroundpictureFile = "piclib://Enterprise Architecture.piclib#Storage\Tape Deck.png"

              s.CustomPictureFile  = "U:\x\sunflower.gif"

                s.Shadow = TRUE

             end if

      

            next

       

     End If 

   next

makes this this:

e voala !

Message was edited by: dirk jaeckel

former_member217396
Participant
0 Kudos

OK, something like this works ...

Dim LogoType

Set LogoType = L2ProcessModelDiagram.CreateObject(PdCommon.cls_RectangleSymbol)

LogoType.Height = 4000  

LogoType.Width = 4000

LogoType.BackgroundPictureFile = EvaluateNamedPath("%_ICONS%\logo.png")

Thanks!