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?
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?
Paolo Maggiani said:In this way I get Visual Basic Reference Help, not MicroStationVBA Help.
It works when cursor is on function / method / object belonging to MicroStation VBA.
Paolo Maggiani said:but I wish view the code of CreateLineELementLIne2. How could I do?
Why? It does not makes sense. It's API!
What would be the benefit to know C/C++ code creating a bridge between native C/C++ MicroStation API and Windows COM API, which is used in VBA?
Paolo Maggiani said:CellsVBA.mvba
The code is just a mess! Why MicroStation VBA methods (like CreateLineElement2) are overloaded by own function (locally defined CreateLineElement2 method)? Such code cannot work.
Paolo Maggiani said:I get Visual Basic Reference Help, not MicroStationVBA Help
Read this article about VBA help.
Press F1 in the VBA editor...
String
Element
Both files are compiled HTML help (*.chm) files.
*.chm