' VB Script Document ' Original von Bernd Ruethschilling fr TCAD Script Centre ' leicht angepasst von mike kuhn option explicit Dim TCApp Dim ActiveDrawing Set TCApp = GetObject("", "TurboCAD.Application") Set ActiveDrawing = TCApp.ActiveDrawing Dim sel, i, ttext, undorec, undotest, tgraphic Set sel = ActiveDrawing.Selection undotest = false Dim Stellen Dim SelCount Dim ItemSel Dim NameSel Dim PropCount Dim ItemProp, Pos1 Dim NameProp, WertProp, LangerWert, DritteStelle, Info, Wertbis2 Dim ValueProp Stellen = 2 For i = 0 to sel.count -1 ttext = sel(i).Properties("Info") If Mid(sel(i).Type, 6, 3) = "Dim" Then ' wenn es kein Dim ist dann ende if undotest = false then undotest = true Set undorec = ActiveDrawing.AddUndoRecord("Dritte Masszahl Hochstellen") end if undorec.AddGraphicForModify (sel(i)) 'This is the bit that does the reformating LangerWert = sel(i).Properties.Item("$DIMVALUE").Value Pos1 = InStr(1, LangerWert, ",", 1) 'sucht den Punkt (Dezimalstelle) DritteStelle = Mid(LangerWert, (Pos1 + 3), 1) Wertbis2 = Left(LangerWert, Pos1 + 2) sel(i).Properties.Item("$DIMDEC").Value = Stellen ' Masszahl auf 2 Nachkommastellen setzen Info = sel(i).Properties.Item("Info").Value If Left(Wertbis2, 2) = "0," Then Wertbis2 = Mid(Wertbis2, 3, 2) If Left(Wertbis2, 1) = "0" Then Wertbis2 = Mid(Wertbis2, 2, 1) Info = Wertbis2 + "\S" + DritteStelle + "^ ;" ' dritte stelle anfgen und hochstellen If DritteStelle <> "" And DritteStelle <> "0" Then sel(i).Properties.Item("Info").Value = Info End If If DritteStelle = "0" Or DritteStelle = "" Then Info = Wertbis2 sel(i).Properties.Item("Info").Value = Info End If End If Next if undotest = true then undorec.close activedrawing.activeview.refresh