Quantcast
Channel: MicroStation Programming Forum - Recent Threads
Viewing all articles
Browse latest Browse all 4331

[CONNECT U14 VBA] Create Parametric Solids?

$
0
0

Is it possible to create parametric solids with VBA?

The only VBA methods I can find for adding cylinders to a model create "Smart Solids" which can't be manually edited after they are drawn (at least not like parametric solids). I wrote the code below as a quick test. I would like to create Parametric Solids so that solids can be manually modified through element properties later if necessary.

For additional reference I have also attached a dgn file with code generated smart solid in red (not desired) and a parametric solid in green (preferred) that I manually added using standard CONNECT modeling tools. 

Thanks.

Sub Test3D()
  Dim myCylinder1 As SmartSolidElement'Set SmartSolidElement = Object.CreateCylinder(Template, radius, Height)
  Set myCylinder1 = SmartSolid.CreateCylinder(Nothing, 2500, 7500)'ActiveModelReference.AddElement myCylinder1
  Dim myCylinder2 As SmartSolidElement
  Set myCylinder2 = SmartSolid.CreateCylinder(Nothing, 2500 - 500, 7500)'ActiveModelReference.AddElement myCylinder2'Set SmartSolidElement = object.SolidSubtract (body1, body2)
  Dim myShell As SmartSolidElement
  Set myShell = SmartSolid.SolidSubtract(myCylinder1, myCylinder2)
  ActiveModelReference.AddElement myShell
End Sub
communities.bentley.com/.../3D-test.dgn

Viewing all articles
Browse latest Browse all 4331


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>