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 - sravang

Pages: [1] 2 3
1
Hello,

I have different types of tags to be added. I am using following code to add them in c#.

 
Code: [Select]
EA.TaggedValue customAttributeTag = ele.TaggedValues.AddNew(attribute,GetPropertyType(shape,attribute,out attributeValue,""));
customAttributeTag.Value = attributeValue;
customAttributeTag.Update();

GetPropertyType returns type of tags ex: String,Integer,Float,Date etc.

In the above case it is working fine for String but in case of Integer it is throwing error of cannot convert int to string.

Any Idea about this?

Thanks,
Sravan

2
Hi Geert,

I have used Repository.GetContextObject() function to get current selected element, so that I can display object_type of that selected element. But this function throws an error when we select package or diagram. Is there any way so that we can use this function without any error and also one more help can we add this click under right click option of an element instead of our addin menu options.Right now it comes under specialize->Addin menu.

Thanks,
Sravan

3
Hi Geert,

Thanks for your reply. Is there any way can I add one option on right click to display object_type through my c# addin?

Thanks,
Sravan

4
Hello,

I am not able to find Object_Type of an element in UI inside properties of an element. I can see stereotype but not able to find object type. Can you suggest me where to look for it in UI

Thanks,
Sravan

5
That worked!.

I have removed update after sqlquery execute and did repo.getelemetbyID again before using that element anywhere again and it worked.

Thank you so much Geert..

6
Yes this is the new element which was created just before updating PDATA1 value, but I ddid property.Update() before and after executing SQL query.

7
Yes,this is the query - "update t_object set PDATA1 = '{FDA55682-C924-49a7-A40D-C38C674956E0}' where Object_ID = 522"

and I verified using this query in sparx - "select * from t_object where Object_ID = 522"

I didn't see any value in PDATA1

8
I have checked in database to verify if it worked, but I was not able to find anything in PDATA1 column. It was empty.

Also tried the same way you mentioned but it also didn't work

Thanks,
Sravan

9
Hello,

I am trying to update PDATA1 value of an element but I am not able to do that. I have gone through forum and found that we can update it through SQL Query and I did the same but was not able to update the value. Can you please let me know why exactly my query didn't work.

QUERY-
update t_object set PDATA1 = '{665E067B-2978-4331-88A7-735269CC00E6}' where Object_ID = 508
code - C#
 string sqlUpdatePdata1 = "update t_object set PDATA1 = '" + embeddedElement.ElementGUID + "'"
                                   + " where Object_ID = " + property.ElementID;
                logger.DebugFormat("Update Query - {0}", sqlUpdatePdata1);
                repository.Execute(sqlUpdatePdata1);

Thanks,
Sravan

10
Automation Interface, Add-Ins and Tools / Re: Part through API
« on: March 10, 2021, 04:22:51 pm »
MISCDATA is has only get property not set property. I mean it is read only property we cannot set that value.

11
Automation Interface, Add-Ins and Tools / Part through API
« on: March 10, 2021, 01:02:07 am »
Hello,

I have gone through forum and found that we can add an part and make it refer to instance of other element by assigning the element ID to classifier id.

But through UI when I add part as mentioned in here - https://sparxsystems.com/enterprise_architect_user_guide/15.2/model_domains/creating_parts_and_ports.html
 I have the guid of instance element in PDATA1 column and ele.MISCDATA[0] through API.

How to set MISCDATA[0] value to GUID of instance element or else how to assign PDATA1 value ??

Thanks,
Sravan

12
Is there anything to do with Type??

One record has type - 'attribute property' and other one has - 'element property'


Thanks,
Sravan

13
Hello,

I don't exactly know why there are multiple entries for one guid in t_xref table.

I am trying to set stereotypeex and fqstereotype values from Description column in t_xref table.

I am using this query to get vaues - "select * from t_xref tx where tx.Client = '{0006EC54-FB51-4d5b-A141-7C9481571FD1}' AND tx.Name = 'Stereotypes'"

For this one it returns two rows with different Type one is attribute property and other is element property.

What exactly should be considered and what is the difference between them.

Thanks,
Sravan

14
Automation Interface, Add-Ins and Tools / How to Add part through API
« on: February 23, 2021, 11:57:11 pm »
Hello,

I am trying to add part to an element through API.

I added it to an element through UI.

In UI I did a right click on element I want to add part and after that I wanted to refer it to an instance of an element and I did by adding in Parts/Properties.

I want to add the same i,e want to refer to an instance of an element for my embedded element through API.

I retrieved the information of instance it is referring to by looking at element.MISCDATA[0].

Thanks,
Sravan

15
Automation Interface, Add-Ins and Tools / Re: Recursive SQL Query in Sparx
« on: February 18, 2021, 11:04:41 pm »
Tried to wrap the statement inside SELECT, but it didn't work.

Pages: [1] 2 3