- UID
- 5043
- 积分
- 1357
- 精华
- 贡献
-
- 威望
-
- 活跃度
-
- D豆
-
- 在线时间
- 小时
- 注册时间
- 2002-5-13
- 最后登录
- 1970-1-1
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
问题:
I need to find a compiled shape file (shx) used by an AcDbLinetypeTableRecord class. How can I determine what shape a linetype uses?
解决方案:
If a line type uses a shx file it will reference an AcDbTextStyleTableRecord. Here is an example that prints the names of the shx file used by the ZIGZAG linetype in acad.lin.
static void ASDKwbTEST(void)
{
AcDbDatabase* pDb = curDoc()->database();
assert(pDb);
//get line type table
AcDbLinetypeTable *pLTTable ;
acdbOpenObject(pLTTable,pDb->linetypeTableId(),AcDb::kForRead);
AcDbLinetypeTableRecord *pLTRecord = NULL ;
AcDbObjectId objLTId ;
//pLTTable->getAt(_T("TRACKS"), objLTId) ;
pLTTable->getAt(_T("ZIGZAG"), objLTId) ;
pLTTable->close();
Acad::ErrorStatus es = acdbOpenObject((AcDbObject *&)pLTRecord, objLTId, AcDb::kForRead) ;
if(es != Acad::eOk)
{
acutPrintf(_T("ZIGZAG linetype not loaded"));
下面是.net实现代码:
Here is a VB.NET example:
<CommandMethod("getShpName")> _
Public Sub GetShapeName()
Dim LtypeNames As New ArrayList()
Dim TextStyleNames As New ArrayList()
Dim db As Database = HostApplicationServices.WorkingDatabase()
Dim ed As Editor = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor
Dim tm As Transaction = db.TransactionManager.StartTransaction()
Try
Dim lineTypTbl As LinetypeTable = tm.GetObject(db.LinetypeTableId, OpenMode.ForRead)
Dim ltTblRec As LinetypeTableRecord
Dim txtStyleTblRec As TextStyleTableRecord
ltTblRec = tm.GetObject(lineTypTbl("ZigZag"), OpenMode.ForRead)
'iterate through the linetype
Dim intDashes As Integer = ltTblRec.NumDashes
|
|