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

Pages: [1] 2 3
1
Thanks for your help guys. In fact, the main problem is that my script is reading the same worksheet Excel 3 times and the worksheet contains 800 lines, so, event with Geert's Suggestion, the code takes long to be executed. I must change my code to optimise or i should evaluate the possibility of changing the language.

2
Hello guys, i have written a code in VBScript inside Enterprise Architect and it is working but it is taking so long to execute it. Is there any command in VBScript such as "Application.ScreenUpdating = False" in VBA, so my code does not last 3 minutes to execute?

4
Thanks for your help Geert. I will make the changes and be sure that the objects i am handling accept the properties. Would you recommend to make diagram update only in the end of the script?

5
As i said, my problem is that i cannot generate the child element inside the parent element, so, as Qwerty said, i would have just to change the size of the parent element. Even though, i am not able to rezise the element

6
Thanks for your answer Geert. Even with the left, top, right and bottom, nothing changes. I am sorry for the misunderstanding, it is beacause my software is in french  :) But, basically the problem is that when i use the properties i have mentioned, it appears an error that says the objet do not handle the property. I leave here examples of the code i am using and i am having this problem.
Code: [Select]
set newObject = diagram.DiagramObjects.AddNew("", "")
newObject.SetAppearance 0,0,100,50
                newObject.SetGeometry 0,0,100,50
                newObject.Width = 100
                newObject.Height = 50
                diagram.Update()

7
Is the only way to resize an element of a diagram is Manually? I have tried to use the .SetApperance, .SetGeometry and .Width and .Height and none of them worked :( There is always the problem of property related to the object. Do you guys have any recomendation?

8
Ok, thanks for your help.

9
Thanks for your answer, qwerty. You mean the size of the boxes and their position in relation to the diagram?

10
Hello,
with the help of the forum during the last weeks, i have made a script that i can generate "parent" and "child" element and it appears the hierarchy in the project browser. I could also, generate a relationship(Realization) between the elements, when they are generated in a diagram. But, in fact, i would like to put the child element inside the parent element, does anyone know if it is possible using VBscript? For now, i have the parent element as a "stakeholder" and the child element as an "Action". For know i have this script, which works to build the relationship between parent and child.
Code: [Select]
Dim objElement
Set objElement = objElementParent.Elements.AddNew(child, "Action") 
objElement.Update

dim newObjectparent 
set newObjectparent = diagram.DiagramObjects.AddNew("", "")
newObjectparent.ElementID = objElementParent.ElementID   
newObjectparent.Update()
dim newObjectchild 
set newObjectchild = diagram.DiagramObjects.AddNew("", "")
newObjectchild.ElementID = objElement.ElementID   
newObjectchild.Update()
Set connector = objElementParent.Connectors.AddNew("", "Realization") 
connector.SupplierID = objElement.ElementID 
connector.Update()

11
Hi Geert, thanks for your answer. I will try what you propose.

12
Hello guys,
the last line does not work(i can storage the GUID in XML), because i can generated my diagram, but it changes nothing each time - there is no error in the debugger. Is this a Syntax error? Or my Version of EA does not handle the method?
dim diagramGUIDXml      
   diagramGUIDXml = Repository.GetProjectInterface().GUIDtoXML(diagram.DiagramGUID)   'get GUID in XML
   Repository.GetProjectInterface().LayoutDiagramEx diagramGUIDXml, lsDiagramDefault, 50, 50 , 50, true

13
Ah ok, it is just a name to assure you are in the right diagram... I could use the code and the elements are disposed in a better organisation. I will try now to handle the connector, maybe setting them to follow the autoroute layout.

14
Sorry Geert,i did not understand what is an Auto_diagram? Is it possible to set a diagram as "Auto_"? If yes, how do i do it? Is in the moment i create the diagram using my script?

15
Ok, thanks guys. I will try to script, but when i start to lose my hair, i quit hahaha

Pages: [1] 2 3