.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Object data to Aeccpoints

1 REPLY 1
Reply
Message 1 of 2
tdunn3
325 Views, 1 Reply

Object data to Aeccpoints

I want to be able to attach object data to a cogopoint, becuase we are having problems with the attribute data disappearing from the point. Here is what I have so far but getting a Autodesk.Gis.Map.MapException error thrown. 

 

oAeccApp = oAcadApp.GetInterfaceObject("AeccXUiLand.AeccApplication.9.0")
oAeccDoc = oAeccApp.ActiveDocument
oAeccDB = oAeccApp.ActiveDocument.Database

Dim oPoints As Autodesk.AECC.Interop.Land.AeccPoints
Dim oPoint As Autodesk.AECC.Interop.Land.AeccPoint
oPoints = oAeccDB.Points

Dim pointLocation As Point3d = Nothing

Dim location(0 To 2) As Double
location(0) = x
location(1) = y
location(2) = z
oPoint = oAeccDoc.Points.Add(CType(location, Object))
oPoint.RawDescription = myPoints(4)

oPoint.Number = pid
Dim id As ObjectId = PointEntity.FromAcadObject(oPoint)
Dim pt As PointEntity = acTrans.GetObject(id, Autodesk.AutoCAD.DatabaseServices.OpenMode.ForWrite, False)
Dim odtable As ObjectData.Table = tables(tablename)

' Create and initialize an record
Dim tblRcd As Record = Record.Create()
odtable.InitRecord(tblRcd)


Dim val As MapValue = tblRcd(0) ' String type

val.Assign(myPoints(0).Trim)


For cnt = 1 To myPoints.GetUpperBound(0) - 3

val = tblRcd(cnt)
val.Assign(myPoints(cnt + 3))


Next


val = tblRcd(12)
val.Assign(Path.GetFileName(CSV_FileName))


table.AddRecord(tblRcd, id)  ''Autodesk.Gis.Map.MapException is thrown here

1 REPLY 1
Message 2 of 2
tdunn3
in reply to: tdunn3

I solved this by importing the points first and then running through the csv again to apply the object data.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost