Hi
I have used the function mdlMlineStyle_traverse from VBA to get an array with all existing multilinestyles in a drawing, this works fine with Microstation V8i
Now I woild like same funtion in Connect Edition, but I get an error telling "mdlMlineStyle_traverse is not a function"
As far as I can see the funtion is still in the SDK.
Anyone who has got same or similar issue and found a solution.
Thanks in advance
Jan
Jan Christensen said:I have used the function mdlMlineStyle_traverse
The VBA declaration must change for 64-bit addressing used in a 64-bit app such as MicroStation CONNECT.
Post the VBA declaration you're using for V8 and we'll see if we can suggest an update.
Regards, Jon Summers LA Solutions
Thanks for your reply.
Below VBA-code is the from where I call the mdlMlineStyle_traverse function
Function GetMultiLineStyles(MR As ModelReference) As MLineStyleNames Dim CExpression As String CExpression = "mdlMlineStyle_traverse(" & val(AddressOf TraverseFunction) & ", " & _ VarPtr(GetMultiLineStyles) & ", " & MR.MdlModelRefP & ", -1)" GetCExpressionValue CExpressionEnd Function
The code is inspired by:
https://communities.bentley.com/products/programming/microstation_programming/f/archived-microstation-v8-2004-edition-vba-forum/29666/multiline-styles-names
Jan Christensen said:CExpression = "mdlMlineStyle_traverse(" & val(AddressOf TraverseFunction) & ", " & _   VarPtr(GetMultiLineStyles) & ", " & MR.MdlModelRefP & ", -1)""mdlMlineStyle_traverse is not a function"
CExpression = "mdlMlineStyle_traverse(" & val(AddressOf TraverseFunction) & ", " & _   VarPtr(GetMultiLineStyles) & ", " & MR.MdlModelRefP & ", -1)"
"mdlMlineStyle_traverse is not a function"
You're assembling a string to be passed to MicroStation's C expression handler. If a function from the MicroStationAPI is used in such a string, it must be published for the C expression handler to be able to see it. We cannot publish a Bentley function — that must be performed when MicroStation is built.
Clearly, that function is published in MicroStation V8, because your VBA worked. We must assume that the function is not published in MicroStation CONNECT.
I don't see a simple solution for your problem. Can you switch your development to .NET or C++?