guanxiancad2006 发表于 2010-8-11 16:01:00

[讨论][求助]用.netObject ARX 画完图在模型空间里显示问题

我用.netObject ARX写代码 画图为什么在模型空间里不能看到,只能在布局里看到。
如果是比例问题,需要放大,但是怎么设置比例让他画完图正好以合适的比例显示在中央呢?

雪山飞狐_lzh 发表于 2010-8-11 16:13:00

你的代码呢?

guanxiancad2006 发表于 2010-8-11 16:57:00

publicvoid AddLine(System.Data.DataTable dt)
      {
            // Get the current document and database
            Document acDoc = Application.DocumentManager.MdiActiveDocument;
            Database acCurDb = acDoc.Database;
            // Start a transaction
            using (Transaction acTrans = acCurDb.TransactionManager.StartTransaction())
            {
                // Open the Block table for read
                BlockTable acBlkTbl;
                acBlkTbl = acTrans.GetObject(acCurDb.BlockTableId,
                                             OpenMode.ForRead) as BlockTable;
                // Open the Block table record Model space for write
                BlockTableRecord acBlkTblRec;
                acBlkTblRec = acTrans.GetObject(acBlkTbl,
                                                OpenMode.ForWrite) as BlockTableRecord;
                for (int j = 0; j
                  if (!Convert.IsDBNull(dt.Rows["p2.X"]) && !Convert.IsDBNull(dt.Rows["p2.Y"]) && !Convert.IsDBNull(dt.Rows["p2.Hight"]) &&
                        !Convert.IsDBNull(dt.Rows["t1.X"]) && !Convert.IsDBNull(dt.Rows["t1.Y"]) && !Convert.IsDBNull(dt.Rows["t1.Hight"]))
                  {
                        // Create a line
                        Line acLine = new Line
                            (
                                        new Point3d
                                        (
                                          Convert.ToDouble(dt.Rows["t1.X"]),
                                          Convert.ToDouble(dt.Rows["t1.Y"]),
                                          Convert.ToDouble(dt.Rows["t1.Hight"])
                                        ),
                                       new Point3d
                                       (
                                       Convert.ToDouble(dt.Rows["p2.X"]),
                                       Convert.ToDouble(dt.Rows["p2.Y"]),
                                       Convert.ToDouble(dt.Rows["p2.Hight"])
                                        )
                           );
                        acLine.SetDatabaseDefaults();
                        // Add the new object to the block table record and the transaction
                        acBlkTblRec.AppendEntity(acLine);
                        acTrans.AddNewlyCreatedDBObject(acLine, true);
                  }

                }            
                // Save the new object to the database
                acTrans.Commit();
            }
      }
   这是我的代码

guanxiancad2006 发表于 2010-8-11 17:00:00


public void AddPointAndSetPointStyle(System.Data.DataTable dtblPoint )
{
// Get the current document and database
Document acDoc = Application.DocumentManager.MdiActiveDocument;
Database acCurDb = acDoc.Database; // Start a transaction
using (Transaction acTrans = acCurDb.TransactionManager.StartTransaction())
{
// Open the Block table for read
BlockTable acBlkTbl;
acBlkTbl = acTrans.GetObject(acCurDb.BlockTableId,
OpenMode.ForRead) as BlockTable; // Open the Block table record Model space for write
BlockTableRecord acBlkTblRec;
acBlkTblRec = acTrans.GetObject(acBlkTbl,
OpenMode.ForWrite) as BlockTableRecord;
for (int i = 0; i 怎么设置图纸的比例尺
页: [1]
查看完整版本: [讨论][求助]用.netObject ARX 画完图在模型空间里显示问题