Good evening,
I am making some attempts to write code to practice VBA for MS. I have found many code examples on several sites and in many cases they call the following procedures:
CreateLineElement2 (myElement as Element, StartPt as Point3d, EndPt as Point3d) as LineElement;CreateEllipseElement2 (Nothing; CenterPoint, 0.5, 2, myMatrix);CreateTextElement1 (Nothing; "Example", myText, myMatrix);CreateCellElement1 ("NewCell"; myLine, PositionPt).
I have not understood if these procedures are "standard" and therefore already present in the VBA Microstation code by activating some additional component.Could anyone please help me?
Thanks a lot.
Regards,Paul
Hi Paolo,
I do not quite understand your question. What do you mean by "standard" and "additional component"?
The methods you mentioned (and many others CreateXXX) are part of MicroStation VBA API.
Did you read e.g. Learning MicroStation VBA book?
With regards,
Jan
P.S. In programming, usually the best way how to check some aspect or feature, is to write own code to test it ;-)
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
OK. How could I add them to my project and how could I find procedures I need?
Paolo Maggiani said:How could I add them to my project
No reason to add them to the project, they should be available automatically.
Technically they are available in Bentley MicroStation DGN 8.9 Object Library, which is referenced automatically when new MicroStation VBA (mvba) project is created.
Paolo Maggiani said:and how could I find procedures I need?
Sorry, I do not understand :-(
To use MicroStation VBA help file?
And as everything in software development, it's about a practice and understanding how API is structured (which is again about the practice). Also, to try to analyze and understand existing code (both examples in help file and mvba examples delivered with MicroStation installation), leads to better understanding of API.
Jan Šlegr said:No reason to add them to the project, they should be available automatically.
How could I check it?
if I use "CreateLineElement2" , I got an error because it doesn't find the procedure. How can I solve?
Paolo Maggiani said:if I use "CreateLineElement2" , I got an error because it doesn't find the procedure
Method CreateLineElement2 is part of MicroStation VBA, which is installed automatically with MicroStation. Have you created a VBA project within MicroStation?
CreateLineElement2
Regards, Jon Summers LA Solutions
I have only this two helps!
Paolo Maggiani said:I have only this two helps!
No, you do not.
Every MicroStation installation contains:
Search for .chm files in MicroStation folders.
Paolo Maggiani said:How can I solve?
How can we answer when we do not provide any information what you did?
Share your mvba file, so it can be tested on another computer.
Or use .mvba example(s) delivered with MicroStation installation as template, because the examples work for sure.
Regards,
Jan Šlegr said:MicroStation VBA help
How can I open it?
Paolo Maggiani said:How can I open it?
F1 in VBA editor, when pointing to MicroStation VBA method?
What is so complicated to try to find .chm files in MicroStation installation?
CellsVBA.mvba
Jan Šlegr said:Share your mvba file, so it can be tested on another computer.
Jan Šlegr said:F1 in VBA editor, when pointing to MicroStation VBA method?
In this way I get Visual Basic Reference Help, not MicroStationVBA Help.
Jan Šlegr said:What is so complicated to try to find .chm files in MicroStation installation?
I found it in the folder... but why I don't get it in the editor?
Code works well, but I wish view the code of CreateLineELementLIne2. How could I do?