Hello,
First, I'm French, so sorry for my bas English.
I have tried to make a VBA macro to create a cellElement. But I Have an unknown error on the function.
Sub placeCell()Dim bscale As Point3dbscale = Point3dOne ' all components 1.0Dim origin As Point3dorigin.X = 0origin.Y = 50origin.Z = 0Dim oCell As CellElementSet oCell = Application.CreateCellElement2("example", origin, bscale, False, Matrix3dIdentity)End Sub
Can you help me?
Thanks a lot
Hi,
what "unknown error" means? Is there any error number?
CreateCellElement2 doesn't create cell elemenet in fact, but it finds the cell with the defined name in attached cell library. Does the cell "example" exists in your cell library and is this library attached or included in MS_CELLLIST variable?
With regards,
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
Ok, sorry, I forget to attach the library.
Often it's better to set MS_CELLLIST variable, so you don't need to take care to attach a library ;-)
If this is part of a larger application you may want to look into either seeing what cell libraries are listed in the MS_CELLLIST cfg var using the workspace object. Or you can use the CellInformationEnumerator to look through the attached cells and see if the cell name that you are working with is in the list. It could add a lot of overhead to a small application but might help in a larger application.
HTH,
mark anderson [Bentley]
Visit me at https://communities.bentley.com/communities/other_communities/bentley_innovation/default.aspx