1
Tables / Re: Create simple table
« on: November 18, 2015, 11:22:03 AM »
Thanks old friend was very helpful.
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
ok. see attached. Thanks!
The block i'm using is multiline annotative. the program inserts the wells utilizing an asc well coordinate file.
We currently have guides for Maya and AutoCAD in the works. While many of this blog’s readership won’t need this kind of assistance, I think many will enjoy what Stephen Preston is cooking up for AutoCAD. ;-)
Dim myblockdef As BlockTableRecord = _
myBlocktable(BlocknameOnly).GetObject(OpenMode.ForRead)
Dim myblockdef As BlockTableRecord = _
myBlocktable(BlocknameOnly).GetObject(OpenMode.ForWrite)
myblockdef.Annotative = AnnotativeStates.True
If btr.Annotative = AnnotativeStates.True Then
Dim ocm As ObjectContextManager = db.ObjectContextManager
Dim occ As ObjectContextCollection = ocm.GetContextCollection("ACDB_ANNOTATIONSCALES")
ObjectContexts.AddContext(bref, occ.CurrentContext)
End If
Module Module1
Sub Main()
Dim a As New InheritsBaseClass
a.MessageBox()
a.MessageBoxBase()
End Sub
End Module
Public Class BaseClass
Public Overridable Sub MessageBox()
MsgBox("Base Class")
End Sub
End Class
Public Class InheritsBaseClass : Inherits BaseClass
Public Overrides Sub MessageBox()
MsgBox("Derived Class")
End Sub
Public Sub MessageBoxBase()
MyBase.MessageBox()
End Sub
End Class
[CommandMethod("CopyExternalLayout")]
public static void CopyExternalLayout()
{
Database db = HostApplicationServices.WorkingDatabase;
Database stdDb = new Database();
stdDb.ReadDwgFile(@"C:\Test\PageSetup.dwg", FileOpenMode.OpenForReadAndAllShare, false,"");
using (Transaction trx = db.TransactionManager.StartTransaction())
using (Transaction stdTrx = stdDb.TransactionManager.StartTransaction())
{
DBDictionary stdLayoutDictionary = stdDb.LayoutDictionaryId.GetObject(OpenMode.ForRead) as DBDictionary;
Layout stdLayout = stdLayoutDictionary.GetAt("TestPageSetUp").GetObject(OpenMode.ForRead) as Layout;
BlockTableRecord paperSpace = SymbolUtilityServices.GetBlockPaperSpaceId(db).GetObject(OpenMode.ForRead) as BlockTableRecord;
Layout layout = paperSpace.LayoutId.GetObject(OpenMode.ForWrite) as Layout;
layout.CopyFrom(stdLayout);
trx.Commit();
}
}
<CommandMethod("CopyExternalLayout")> _
Public Shared Sub CopyExternalLayout()
Dim db As Database = HostApplicationServices.WorkingDatabase
Dim stdDb As Database = New Database()
stdDb.ReadDwgFile("C:\Test\PageSetup.dwg", FileOpenMode.OpenForReadAndAllShare, False, "")
Using trx As Transaction = db.TransactionManager.StartTransaction()
Using stdTrx As Transaction = stdDb.TransactionManager.StartTransaction()
Dim stdLayoutDictionary As DBDictionary = stdDb.LayoutDictionaryId.GetObject(OpenMode.ForRead)
Dim stdLayout As Layout = stdLayoutDictionary.GetAt("TestPageSetUp").GetObject(OpenMode.ForRead)
Dim paperspace As BlockTableRecord = SymbolUtilityServices.GetBlockPaperSpaceId(db).GetObject(OpenMode.ForRead)
Dim layout As Layout = paperspace.LayoutId.GetObject(OpenMode.ForWrite)
layout.CopyFrom(stdLayout)
End Using
trx.Commit()
End Using
End Sub