Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - David Rains (bioform)

Pages: 1 ... 4 5 [6]
Perfect timing! I had the source open and was browsing the TMF wiki!!
WOW that is some resource!

Just make sure you and Palo never pass on to the next what ever okay? ;)

May your hair continue to grow and your feet never hurt!  :)
Now to go hide, read, and learn!  :)

Thanks again, and yes it is 3:30 AM and I should be in bed over here!


Just tried using Clng to force the subtype to long... but still getting that same error?!

thank god I'm going bald, because I don't have to go the hair pulling route to vent :)

David "Quicker in the Shower" Rains

I have been trying this using VBScript which supports only a variant type. I tried to force the issue by making this change
supplierElement = Repository.GetElementByID(int(supplierID))
But I still get the same error....

Now you might ask why don't I use VS2008 pro that I have installed on my laptop... good question. I tried to run the conversion for the VS2003 C# add-in example and the conversion was unsuccessful.

What I would LOVE to see posted is a add-in framework template in VB or C# for 2008... Hint Hint EA Admins :) - I can hack some pretty complex code using VBA but getting my 2008 environement set up to run the examples using outdated info been very fustrating on my end...

<whine whine whine...> :)


Well, I have done the rewrite and I am still getting the original error mesage when I try to GetElementByID.... Here is the code snippet
45 - dim supplierID
46 - supplierID = theConnector.SupplierID
47 -                    
48 - dim supplierElement as EA.Element
49 - supplierElement = Repository.GetElementByID(supplierID)

The error message is.... Object doesnt support this property or method. Line49.

I check the value with a msgbox and it displays "supplierID: 80" which is correct when I check the t_object table

Thanks for your help BTW :)

Okay, I decided to take a different more direct tack...
- Manually select the association-class connector in the diagram
- load the connector data
dim theDiagram as EA.Diagram
set theDiagram = Repository.GetCurrentDiagram

dim theConnector as EA.Connector
set theConnector = theDiagram.SelectedConnector
Everything working at this point... can see values for SupplierID and ClientID .... saved them to variables supplerID and clientID

Next load the supplier element's data
dim theSourceElement as EA.Element
set theSourceElement = Repository.GetElementByID(supplierID)
msgbox "Source: " & theSourceElement.ElementID, vbOkayOnly

Nothing? I re-read the snippet about GetElementByID and this seems to refer NOT to the EA assigned object ID, but to a local value of a collection?

Is there NOT a simple way to reference a element directly if you know it's EA objectID?

I seem to be finding myself in need of some basic code snippets to understand locating objects (elements, connectors, packages, etc.). I have checked the local scripts but they mostly depend on the element being already selected on the project tree (Repository.GetTreeSelected... )

BTW when are you starting that book Geert? :)

Yes, it is an association class that I stereotyped as a "Wording". The other is relatively simple. But EA creates a connector entry for the A-B association, and then stores the Object ID of C (the assocated class - in this case my stereotyped FactType class) in the connector's PDATA1 as a string value.

Since I am rather new to the use of scripting in EA (today is my first day in fact) I am unsure of HOW to:

Identify the connector ID when all I know is the object ID of the associated class (C)... I was assuming I could look at a collection of connectors, then examine the PDATA field for the Object ID value of C.

I noticed from reading earlier posts that the connectors are not treated like a regualr collection? I tried to just run through a collection of connectors, but kept getting a message about method not being available... even though auto-sense shows it....

I will post a snippet of my script to show where I am having the problem and error message.

BTW it sure is fun to be back working with EA... :) Still on version 7.5 but am planning on updating in the next week or so.... waiting for new job to start... :)



I am working on a set of shape scripts to support SBVs (structured business vocabularies). I am trying to, via scripts, to locate the source class for an associated class (e.g., have Class1 and Class2, drag association class connector between the two and Class3 is created).

The issue I am having is how to locate the object ID of the source class( Class1) from the Class3 element in a script? If I remember right an associated classes' ID is stored in the connector's PDATA1 field...

Previously I did this by SQL calls to a hosted EA model (find the instance of the stereotyped Class3 object ID in the connector table under PDATA1, then use the StartObjectID and EndObjectIDs to find their tagged values I am interested in....

SBV Example: Class1 (term) is named "Dog", Class2 (term) is named "Hand", created associated class using connector and it will be named "DOG bites Hand" (a fact type), the verb "bites" would be displayed as the name label of the association, etc.

thanks for the help in advance... (aka Bioform)

Pages: 1 ... 4 5 [6]