3D Text Extrusion through VBA

Hi Team,

I am Trying to Extrude the Text As follows and with Following code,

and was Giving a try through Smart Solid Extrusion Option,

Could you please suggest the Best Possible way.

[<Microstation V8i (Select Series 4) Version 08.11.09.829>]

 

Dim oEleText as TextElement
BasePnt = Point3dFromXYZ(0,0,0)
Set oEleText = CreateTextElement1(Nothing, "Some Text", BasePnt, Matrix3DIdentity)
Dim ExtrusionText as SmartSolid
Set ExtrusionText = SmartSolid.ConvertToSmartSolidElement(oEle)
Set ExtrusionText = SmartSolid.ExtrudeClosedPlanarCurve(oEle,20,0,True)

Thanks,

Parents
  • I need to Extrude Text Element

    A TextElement is a special kind of element, because it doesn't display intrinsic geometry.  Instead, it renders the font specified in its Text Style

    An extrusion requires a planar profile, typically a 2D shape.  You must convert each letter in a word to a 2D profile, then you can extrude it.  To do that you must 'stroke' each letter: stroking means to create a set of lines that describe the letter geometrically.

    Use the TextElement.Drop method to obtain an ElementEnumerator of primitive elements from a single letter.  Convert those primitives into a closed shape which you can extrude.

     
    Regards, Jon Summers
    LA Solutions

  • Dim oCmpString as ComplexStringElement
    Do While oComp.MoveNext
        Dim oEle as Line Element
        Set oEle = oComp.Current
        Vertices = oEle.AsVertexList.GetVertices
        Set Oline = CreateLineElement1(Nothing,Vertices)
        Set oStrEle(oCompCount) = oLine 'oComp
        oCompCount = oCompCount + 1
    Loop    
    Set oCompString = CreateComplexStringElement1(oStrEle)
    oCompString.LineWeight = 10
    ActiveModelReference.AddElement oCompString
    oCompString. Redraw msdDrawingModeNormal
    

    Use the TextElement.Drop method to obtain an ElementEnumerator of primitive elements from a single letter.  Convert those primitives into a closed shape which you can extrude.

    HI Jon,

    I tried With Method as you said and I am getting following output, Could you please let me know what modification I need to make?

    Thanks,

  • Use the TextElement.Drop method to obtain an ElementEnumerator of primitive elements from a single letter.  Convert those primitives into a closed shape which you can extrude.
    Could you please let me know what modification I need to make?
    Set oCompString = CreateComplexStringElement1(oStrEle)

    You're creating a complex string, not a complex shape.  To extrude requires a closed 2D shape.

    Also, your screenshot shows a stick font (i.e. composed of lines and arcs).  Compare that with 's screenshot that shows letters that are shapes.  You can't extrude a line or arc because those are not closed shapes.  Choose the right font to extrude.

     
    Regards, Jon Summers
    LA Solutions

Reply
  • Use the TextElement.Drop method to obtain an ElementEnumerator of primitive elements from a single letter.  Convert those primitives into a closed shape which you can extrude.
    Could you please let me know what modification I need to make?
    Set oCompString = CreateComplexStringElement1(oStrEle)

    You're creating a complex string, not a complex shape.  To extrude requires a closed 2D shape.

    Also, your screenshot shows a stick font (i.e. composed of lines and arcs).  Compare that with 's screenshot that shows letters that are shapes.  You can't extrude a line or arc because those are not closed shapes.  Choose the right font to extrude.

     
    Regards, Jon Summers
    LA Solutions

Children
No Data