.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Reply
Message 1 of 2
MBarnes
251 Views, 1 Reply

Twist UCS

I am trying do get started using

Dim db As DatabaseServices.Database = acadApp.DocumentManager.MdiActiveDocument.Database
Dim trans As DatabaseServices.Transaction = db.TransactionManager.StartTransaction
Dim docLock As DocumentLock = acadApp.DocumentManager.MdiActiveDocument.LockDocument(DocumentLockMode.Write, "CrosshairAlignmentMagLevel", "CrosshairAlignmentMagLevel", True)

Dim ucsTbl As UcsTable = DirectCast(trans.GetObject(db.UcsTableId, DatabaseServices.OpenMode.ForWrite, False), UcsTable)
Dim ucsRec As UcsTableRecord = DirectCast(trans.GetObject(ucsTbl(UcsTableRecord.ModelSpace), DatabaseServices.OpenMode.ForWrite, False), UcsTableRecord)

ucsRec.Origin = New Point3d(19, 109, -55)
ucsRec.XAxis = New Vector3d(1, 0, 0)
ucsRec.YAxis = New Vector3d(0, 1, 0)

I seem to be having trouble accesing the UCSRableRecord so I can move and twist the UCS and update the database.

Should I be looking to do a dllimport on AcDbUCSTableRecord. There is no mention of adjusting a UCS in .net but it's done in the ARX group.

Thanks for any input in advance

Max
1 REPLY 1
Message 2 of 2
MBarnes
in reply to: MBarnes

I found a mistake in that line and fixed it

Dim ucsRec As UcsTableRecord = DirectCast(trans.GetObject(ucsTbl("testUCS"), DatabaseServices.OpenMode.ForWrite, False), UcsTableRecord)

I can now access the UCS and apply methods to it, it takes all the parameters I pass to it (origin, xAxis, yAxis)......

After the transaction is completed the UCS does not move, even tried a regen but somethings still wrong

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