天气与日历 切换到窄版

 找回密码
 立即注册
中国膜结构网
十大进口膜材评选 十大国产膜材评选 十大膜结构设计评选 十大膜结构公司评选
查看: 63|回复: 0

使用ARX创建一个MLINE

[复制链接]

该用户从未签到

主题

0

回帖

2912

积分

管理员

积分
2912
发表于 2024-6-22 09:46:18 | 显示全部楼层 |阅读模式
How to create an Mline using ObjectARX?  

问题:

How do I create an MLINE entity in AutoCAD using ObjectARX? When I try this, an
MLINE is not created and an error message does not occur indicating this was
unsuccessful.

解答:

The most likely cause for this is that you did not set the MLINE style to the
MLINE entity as it was created.

If an MLINE style is not set, AutoCAD does not know how to visually represent
the MLINE despite the fact that the MLine entity is valid and is appended to the
DWG database.

The following code creates an MLINE using the "Standard" MLINE style that is
always present in any DWG database.

NOTE: You can also create another MLINE style using the AcDbMlineStyle ARX
class.
普通浏览复制代码
AcDbMline *l =new AcDbMline ;
l->setNormal (AcGeVector3d (0, 0, 1)) ;
l->setScale (1.5) ;

AcDbDictionary *d ;
acdbHostApplicationServices ()->workingDatabase ()
->getNamedObjectsDictionary (d, AcDb::kForRead) ;
AcDbDictionary *ls ;
d->getAt ("ACAD_MLINESTYLE", (AcDbObject*&)ls, AcDb::kForRead) ;
d->close () ;
AcDbObjectId id ;
ls->getAt ("Standard", id) ;
ls->close () ;

l->setStyle (id) ;

l->appendSeg (AcGePoint3d (0, 0, 0)) ;
l->appendSeg (AcGePoint3d (10, 0, 0)) ;
l->appendSeg (AcGePoint3d (10, 10, 0)) ;
l->appendSeg (AcGePoint3d (20, 20, 0)) ;
l->appendSeg (AcGePoint3d (20, 100, 0)) ;

// Now, the AcDbMline entity is ready to be appended to the DWG database

 

 

 

 

使用ARX创建一个MLINE
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|中国膜结构网|中国膜结构协会|进口膜材|国产膜材|ETFE|PVDF|PTFE|设计|施工|安装|车棚|看台|污水池|中国膜结构网_中国空间膜结构协会

GMT+8, 2024-11-1 15:24 , Processed in 0.186398 second(s), 26 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表