乐筑天下

搜索
欢迎各位开发者和用户入驻本平台 尊重版权,从我做起,拒绝盗版,拒绝倒卖 签到、发布资源、邀请好友注册,可以获得银币 请注意保管好自己的密码,避免账户资金被盗
查看: 50|回复: 3

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

[复制链接]

11

主题

43

帖子

3

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
87
发表于 2010-8-11 16:01:00 | 显示全部楼层 |阅读模式
我用.netObject ARX写代码 画图为什么在模型空间里不能看到,只能在布局里看到。
如果是比例问题,需要放大,但是怎么设置比例让他画完图正好以合适的比例显示在中央呢?
回复

使用道具 举报

72

主题

2726

帖子

9

银币

社区元老

Rank: 75Rank: 75Rank: 75

铜币
3014
发表于 2010-8-11 16:13:00 | 显示全部楼层
你的代码呢?
回复

使用道具 举报

11

主题

43

帖子

3

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
87
发表于 2010-8-11 16:57:00 | 显示全部楼层
  public  void 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[BlockTableRecord.ModelSpace],
                                                OpenMode.ForWrite) as BlockTableRecord;
                for (int j = 0; j
                    if (!Convert.IsDBNull(dt.Rows[j]["p2.X"]) && !Convert.IsDBNull(dt.Rows[j]["p2.Y"]) && !Convert.IsDBNull(dt.Rows[j]["p2.Hight"]) &&
                        !Convert.IsDBNull(dt.Rows[j]["t1.X"]) && !Convert.IsDBNull(dt.Rows[j]["t1.Y"]) && !Convert.IsDBNull(dt.Rows[j]["t1.Hight"]))
                    {
                        // Create a line
                        Line acLine = new Line
                            (
                                        new Point3d
                                        (
                                            Convert.ToDouble(dt.Rows[j]["t1.X"]),
                                            Convert.ToDouble(dt.Rows[j]["t1.Y"]),
                                            Convert.ToDouble(dt.Rows[j]["t1.Hight"])
                                        ),
                                       new Point3d
                                       (
                                         Convert.ToDouble(dt.Rows[j]["p2.X"]),
                                         Convert.ToDouble(dt.Rows[j]["p2.Y"]),
                                         Convert.ToDouble(dt.Rows[j]["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();
            }
        }
     这是我的代码
回复

使用道具 举报

11

主题

43

帖子

3

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
87
发表于 2010-8-11 17:00:00 | 显示全部楼层
[code]
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[BlockTableRecord.ModelSpace],
OpenMode.ForWrite) as BlockTableRecord;
for (int i = 0; i 怎么设置图纸的比例尺
回复

使用道具 举报

发表回复

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

QQ|关于我们|小黑屋|乐筑天下 繁体中文

GMT+8, 2025-6-29 03:39 , Processed in 1.549185 second(s), 71 queries .

© 2020-2025 乐筑天下

联系客服 关注微信 帮助中心 下载APP 返回顶部 返回列表