That`s a MFD8 Script: Sub Main Set windows = Application.WindowSet Set window = windows.ActiveWindow Set component = window.Component ' -- fail if there is no opened windows If windows.Count = 0 Then MsgBox "No active window" Exit Sub End If ' -- fail if active component is not a drawing If component.Type <> ComponentDrawing Then MsgBox "Active component is not a drawing" Exit Sub End If Set sourcedrawing = window.ActiveComponent Set sourceTable = sourceDrawing.OwnedTable Set dataRecords = sourceTable.RecordSet pi = 3.141592653589793 For recordIndex = 0 To dataRecords.Count-1 Set record = dataRecords(recordIndex) '- log starting location x = record.Data("X (I)") y = record.Data("Y (I)") ' -- create point azimuth = CDbl((record.Data("G1P1_Azimut")) * pi / 180) distance = CDbl(record.Data("G1P1_Entfernung")) dx = Sin(azimuth)*distance dy = Cos(azimuth)*distance x1 = x + dx y1 = y + dy Set pointSet = Application.NewPointSet Set point = Application.NewPoint point.x = x1 point.y = y1 pointSet.Add(point) Set geom = Application.NewGeom(GeomPoint, pointSet) ' -- append point sourcedrawing.ObjectSet.Add(geom) ' -- transfer Name field sourceTable.RecordSet(sourceTable.RecordSet.Count - 1).Data("Name") = record.Data("Name") Next End Sub
http://www.thegisservicesector.de |