- UID
- 1
- 积分
- 15891
- 精华
- 贡献
-
- 威望
-
- 活跃度
-
- D豆
-
- 在线时间
- 小时
- 注册时间
- 2002-1-3
- 最后登录
- 1970-1-1
|
发表于 2002-9-2 14:36:39
|
显示全部楼层
给你贴个ADN资料:
How to create an Mline using ObjectARX?
ID 45184
Applies to: AutoCAD 2000
Date 6/22/2000
This document is part of Symbol Tables Named Objects Dictionary MLines
Question
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.
Answer
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 |
|