MicroStation V8i SS4
Hey all, I have create some code to place a cell, record that placement point (oMessage.Point) and then start the "place note" tool and populate the word processor with the value of that point. My issue is that is only giving me the value after the decimal of that point. It is ignoring the data that I need. For instance, if the value is 66927.1878173258 (from the expression watch), it is only pasting 1878173258. I need the full value and only 2 decimal places. I am currently only calling a single variable but eventually it will be all 3.
How do I resolve this issue? Here is the code:
Sub PlaceCoordNoteDEV() Dim startPoint As Point3d Dim oView As View Dim pt1 As Point3d, pt2 As String Dim point As Point3d Dim lngTemp As Long Dim oMessage As CadInputMessage Dim pt1X As Double On Error GoTo cleanup
Do While True
' Set element template and place cell CadInputQueue.SendKeyin "template active general\annotation\text\Text wLeader T10" CadInputQueue.SendKeyin "ac=Location Marker"
'Show messages ShowPrompt "Place ID Point" ShowMessage "Select ID Point in screen" 'CadInputQueue.SendKeyin "set item toolsettings celltruescaletoggle=1"
' Commands below will use the placement point above be recorded and use Set oMessage = CadInputQueue.GetInput(msdCadInputTypeDataPoint, msdCadInputTypeReset) If oMessage.InputType = msdCadInputTypeDataPoint Then CadInputQueue.SendDataPoint oMessage.point pt1 = oMessage.point pt1X = oMessage.point.X
pt2 = CDbl(pt1X) 'Get View Set oView = oMessage.View With CadInputQueue
.SendDataPoint pt1, oView .SendKeyin "choose none" .SendKeyin "place note"
.SendMessageToApplication "WORDPROC", "1 PasteTextInEditor 23" + pt2 .SendDataPoint pt1, oView
'Show Messages ShowPrompt "Select next point for Note placement" ShowMessage "Select next point for Note placement"
Set oMessage = CadInputQueue.GetInput(msdCadInputTypeDataPoint, msdCadInputTypeReset) If oMessage.InputType = msdCadInputTypeDataPoint Then CadInputQueue.SendDataPoint oMessage.point
End If End With
ElseIf oMessage.InputType = msdCadInputTypeReset Then GoTo cleanupEnd If
Loop
cleanup:
CadInputQueue.SendKeyin "choose none"CadInputQueue.SendKeyin "reset"ShowPrompt ""ShowMessage "Macro Exited"
End Sub