- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I am creating an alignment offset for all alignments in my drawing (See the code below), however i am getting this warning message
" Warning 1 'Public Function CreateOffsetAlignment(offsetDistance As Double) As Autodesk.AutoCAD.DatabaseServices.ObjectId' is obsolete: 'Use static method Autodesk.Civil.Land.DatabaseServices.Alignment.CreateOffsetAlignment(...) instead." and there is no output when i run the program
Here is the code
PublicSubT10()
' This Program is to create alignment offset
Dim mydoc AsDocument = Application.DocumentManager.MdiActiveDocument
Dim mytrans AsTransaction= mydoc.TransactionManager.StartTransaction
Dim mycivil AsCivilDocument = Autodesk.Civil.ApplicationServices.CivilApplication.ActiveDocument
Dim ed AsEditor = Application.DocumentManager.MdiActiveDocument.Editor()
Dim alignments AsObjectIdCollection= mycivil.GetAlignmentIds
Dim i AsInteger= 0
Dim x AsDouble = InputBox("Please Enter alignment offset value")
Try
For i = 0 Toalignments.Count - 1
Dim a1 AsAlignment = mytrans.GetObject(alignments(i), OpenMode.ForRead)
Dim a2 AsObjectId= a1.CreateOffsetAlignment(10)
Next
Catch ex AsSystemException
MsgBox(ex.Message)
If mytrans IsNotNothingThenmytrans.Abort()
Finally
MsgBox("This is done By Tamer Mourad")
If mytrans IsNotNothingThenmytrans.Dispose()
EndTry
EndSub
Regards,
Tamer Mourad
Solved! Go to Solution.