Book a Demo

Author Topic: Profile (Shapescript)  (Read 3458 times)

Miracleworker

  • EA Novice
  • *
  • Posts: 12
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Profile (Shapescript)
« on: December 19, 2007, 05:46:23 am »
I tried to create a new profile:
shape main{

//Initialisation attributes
h_align = "center";
v_align = "center";

// Draw component diagram
setpenwidth(1);
rectangle(0,0,403,75);
image ("BGC_GROUP_Logo.emf",0,0,403,75);
}

The image emf is not recognised. BMP or JPG works only for a day or so. Most of the time the next day the image doesn't appear anymore only the empty shape.

Can you help me to get my profile stable?

Greetings,

Eric


«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Profile (Shapescript)
« Reply #1 on: December 19, 2007, 05:56:41 am »
Did you import the images into EA?
No, you can't have it!

Miracleworker

  • EA Novice
  • *
  • Posts: 12
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Profile (Shapescript)
« Reply #2 on: December 19, 2007, 06:35:27 am »
Of course, both emf, jpg and bmp images.

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Profile (Shapescript)
« Reply #3 on: December 19, 2007, 07:15:02 am »
What build of EA are you using?

Also, from somewhere I think I remember that EA uses png images internally. Perhaps that would work. However, bitmaps and metafiles should have been fine.
No, you can't have it!

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: Profile (Shapescript)
« Reply #4 on: December 19, 2007, 02:26:29 pm »
To get images to work with profiles, you will need to either import the images into the target model before importing the profile, or much easier is to create an MDG Technology that bundles profile and images into a single deliverable. "Tools > Generate MDG Technology File" from the main menu.

I'm not sure why EA doesn't recognize the emf file. My only thought is to check ("Settings > Images") that you gave the image the name you think you did - it defaults to the filename, but you can give it any name you like. I don't remember if it's case-sensitive or not.

Lastly, a slight improvement to your shape script... rectangle(), image() and similar commands take percentage values, not actual values, so you should probably use image("name",0,0,100,100); and then give the stereotype attributes _sizeX=403 and _sizeY=75

HTH

The Sparx Team
[email protected]