Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: alvinhsieh on September 19, 2006, 10:42:52 pm

Title: can't set  scale  Attribute ???
Post by: alvinhsieh on September 19, 2006, 10:42:52 pm
For f = 0 To elm.Attributes.count - 1

Set att = elm.Attributes.GetAt(d)

att.Scale="10"

Next
,
i can print att.scale ,but can't setting it ?
please help me
thanks

Title: Re: can't set  scale  Attribute ???
Post by: KP on September 19, 2006, 11:17:32 pm
You may need to do att.Update()
Title: Re: can't set  scale  Attribute ???
Post by: alvinhsieh on September 20, 2006, 05:08:18 am
VB6 can't recognize This line' att.scale ="10" '

But,in debug windows i can print  att.scale.
Title: Re: can't set  scale  Attribute ???
Post by: thomaskilian on September 20, 2006, 11:44:36 am
It's probably an integer?
Title: Re: can't set  scale  Attribute ???
Post by: alvinhsieh on September 21, 2006, 02:55:36 am
in help->
mk:@MSITStore:C:\Program%20Files\Sparx%20Systems\EA\EA.chm::/attribute.htm
scale attribute is  String
'Scale  String  Read/Write.  Scale value. '

this problem seem come from VB6 ,because  in design time VB6 IDE  'att.scale ="10"' will turn to red.
Title: Re: can't set  scale  Attribute ???
Post by: thomaskilian on September 21, 2006, 02:27:20 pm
Despite of the help: did you try to assign an integer?
Title: Re: can't set  scale  Attribute ???
Post by: alvinhsieh on September 22, 2006, 12:30:29 am
Set att = Elm.Attributes.GetAt(f)
att.Update
att.Scale =1

assign integer ,result is same.
Title: Re: can't set  scale  Attribute ???
Post by: «Midnight» on September 22, 2006, 04:01:33 am
Remember to call att.Update() again after the assignment, otherwise EA will silently ignore the new value.
Title: Re: can't set  scale  Attribute ???
Post by: thomaskilian on September 25, 2006, 02:31:25 pm
Looks like the interface definition from Sparx is not right (can't remember the suffix of those files) as VB complains about the wrong type. Did anyone from Sparx try this sample, Neil?
Title: Re: can't set  scale  Attribute ???
Post by: Whitestar on June 28, 2007, 07:08:56 am
VB seems to be expecting the syntax for its own built-in Scale method, i.e.:
         object.Scale (x1,y1) - (x2,y2)

This is why it complains & asks for a bracket.

This is clearly a bug.  Sparx guys: is there a fix for this?
Title: Re: can't set  scale  Attribute ???
Post by: «Midnight» on June 28, 2007, 09:26:05 am
You should submit this as a bug to Sparx directly. The help entry for the Scale property does not appear to be corrected through build 812 (EA &.0 beta 3) inclusive.

You can find the correct form by clicking the Support link at the top of any forum page, then clicking Bug Report in the left side menu. Or from the EA main menu choose Help | On-line Resources | Bug Report Page.

David
Title: Re: can't set  scale  Attribute ???
Post by: Aaron B on June 28, 2007, 02:16:45 pm
I don't think this is a problem with EA's interface.  The problem here is that 'Scale' is unfortunately a keyword in VB.  To get around this, put square brackets around Scale and it should work.
e.g.   attrib.[Scale] = 1
Title: Re: can't set  scale  Attribute ???
Post by: «Midnight» on June 28, 2007, 04:26:15 pm
Yep, that would likely help...
Title: Re: can't set  scale  Attribute ???
Post by: Whitestar on June 28, 2007, 10:01:13 pm
Quote
I don't think this is a problem with EA's interface.  The problem here is that 'Scale' is unfortunately a keyword in VB.  To get around this, put square brackets around Scale and it should work.
e.g.   attrib.[Scale] = 1


Thanks for that.  It works perfectly. :)
I didn't know you could do that in VB!!!

Well done.

Cheers,

Paul
Title: Re: can't set  scale  Attribute ???
Post by: thomaskilian on June 28, 2007, 10:21:28 pm
N.B. In Perl (I also learned from Sparx) you have to use braces like $attrib->{Scale} = 1 to make an assignment while $attrib->Scale also legally prints the contents. I did not know that Perl and VB are so related ;)