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

  • In MicroStation, it is possible to extrude text - which is where I got the image from above. I recorded the macro, which gave the following. I am no programmer, so the 'SetCExpressionValue' line is something I would not be able to explain - especially as the Help file says "It should be used with extreme caution".

    Sub BmrExtrudeText()
        Dim startPoint As Point3d
        Dim point As Point3d, point2 As Point3d
        Dim lngTemp As Long
        Dim oMessage As CadInputMessage
    
    '   Start a command
        CadInputQueue.SendCommand "TEXTEDITOR PLACE"
    
    '   XX-MacroComment_Header-XX
    
    '   XX-MacroComment_InsertText-XX
    
    '   Send a keyin that can be a command string
        CadInputQueue.SendKeyin "TEXTEDITOR PLAYCOMMAND INSERT_TEXT ""Hello"
    
    '   Coordinates are in master units
        startPoint.X = 11497.4738347053
        startPoint.Y = 6299.18710732207
        startPoint.Z = 2949.10524430915
    
    '   Send a data point to the current command
        point.X = startPoint.X
        point.Y = startPoint.Y
        point.Z = startPoint.Z
        CadInputQueue.SendDataPoint point, 1
    
    '   Send a reset to the current command
        CadInputQueue.SendReset
    
        CadInputQueue.SendCommand "CONSTRUCT SURFACE PROJECTIONSOLID"
    
        point.X = startPoint.X
        point.Y = startPoint.Y
        point.Z = startPoint.Z
        CadInputQueue.SendDataPoint point, 1
    
    '   Set a variable associated with a dialog box
        SetCExpressionValue "tcb->ms3DToolSettings.extrude.nonParametric", 1, "SOLIDMODELING"
    
        CadInputQueue.SendCommand "CONSTRUCT SURFACE PROJECTIONSOLID"
    
        point.X = startPoint.X
        point.Y = startPoint.Y
        point.Z = startPoint.Z
        CadInputQueue.SendDataPoint point, 1
    
        point.X = startPoint.X
        point.Y = startPoint.Y
        point.Z = startPoint.Z + 6.59094744303775
        CadInputQueue.SendDataPoint point, 1
    
        CommandState.StartDefaultCommand
    End Sub



  • it is possible to extrude text

    Well, bless my soul!  I live and learn.

     
    Regards, Jon Summers
    LA Solutions

Reply Children
No Data