I am trying to write an Addin that should generate 3D tubes using SmartSolid.SweepProfileAlongPath, but i dont seem to work in Connect.
To test I have created this very simpel vba macro:
Sub Ledninger_3D() Dim punkter() As Point3d Dim cirkel As EllipseElement Dim line As LineElement Dim sSolid As SmartSolidElement ReDim punkter(3) punkter(0) = Point3dFromXYZ(0, 0, 0) punkter(1) = Point3dFromXYZ(0, 0, 50) punkter(2) = Point3dFromXYZ(50, 50, 100) punkter(3) = Point3dFromXYZ(50, 50, 150) Set cirkel = CreateEllipseElement2(Nothing, punkter(0), 10, 10, Matrix3dIdentity, msdFillModeFilled) Set line = CreateLineElement1(Nothing, punkter) Set sSolid = SmartSolid.SweepProfileAlongPath(cirkel, line) ActiveModelReference.AddElement sSolid sSolid.Redraw End Sub
The macro works fine in MicroStation V8i SS4, but not i MicroStation Connect Update 12, can anyone tell what is wrong?
Peter Norvin said:The macro works fine in MicroStation V8i SS4, but not i MicroStation Connect Update 12
That's very frustrating! Does it make any difference if you add the circle & line to the DGN model before the extrusion?
I see this error in MicroStation CONNECT Update 13.1:
Peter Norvin said:sSolid.Redraw
sSolid.Redraw
You shouldn't need to redraw an element after adding it to the active model.
Regards, Jon Summers LA Solutions
I have tried to add the circle and line to the model, but it makes no dífference.
Thank's for the tip about Redraw.
Peter Norvin said:I have tried to add the circle and line to the model, but it makes no dífferenc
You have a simple and reproducible problem. File a Service Request (SR) with Bentley Systems, submitting your VBA code as evidence.
Occasionally it's possible to short-circuit the lengthy SR procedure by persuading Artur Goldsweer to take an interest in your problem.
Answer Verified By: Peter Norvin
I will do that.
Hi Peter Norvin,
Do you mind trying your code snip in a new MicroStation VBA project (and module) by itself to see if that works?
I tried this in a pre-release release build of MicroStation Update 14 and it appears to be working fine (in its own project). It is a good practice to add 'Option Explicit to the top of each type of: Class, Module and Form; to ensure the compiler (Debug > Compile <ProjectName>) can catch any typo's and/or explicit errors possible.
I will mention this to Artur to see if he can verify if the problem previously existed in Update 13 and likely fixed in Update 14 (<1 month to release).
Thank you and HTH,Bob
Hi Bob,
Robert Hook said:I tried this in a pre-release release build of MicroStation Update 14 and it appears to be working fine
It's a good news, thanks!
Robert Hook said:I will mention this to Artur to see if he can verify if the problem previously existed in Update 13
I tried to copy the code (plus modified it a bit to make it cleaner) to Update 13 project and the same error is reported as discussed for U12. So it seems it has been fixed after U13 release.
With regards,
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
Hi Bob
Thank you for the answer.
I usually write Addins using C# and Visual Studio, so the vba test was conducted in empty projects with no other code.
I look forward to the new release.
Best regards Peter
Hi All,
this issue was reported with Update 12 and a fix could be added in the early phase of Update 14.I have also just tested again and can confirm the fix will be available with the upcoming Update 14 release.
Thanks for reporting the issue.
Best regards,Artur