基本上,我取点,画线,闭合一个环,然后创建一个区域。但这是我遇到麻烦的部分,当试图挤出该区域时,我一无所获。有人有解决方案或修复方法吗?
谢谢
-
- Dim acDBObjColl As DBObjectCollection = New DBObjectCollection()
- Dim myRegionColl As DBObjectCollection = New DBObjectCollection()
- Dim acRegion As Region ' = CType(myRegionColl(0), Region)
-
- Dim solidObj As Solid3d = New Solid3d()
- ' Create a line
- acLine = New Line(New Point3d(xStart, yStart, zStart), _
- New Point3d(xClose, yClose, zClose))
- acLine.SetDatabaseDefaults()
- acBlkTblRec.AppendEntity(acLine)
- acTrans.AddNewlyCreatedDBObject(acLine, True)
- acDBObjColl.Add(acLine)
- ' make reagion for each layer
- myRegionColl = Region.CreateFromCurves(acDBObjColl)
- ' Add the new region object to the block table record and the transaction
- acRegion = CType(myRegionColl(0), Region)
- acRegion.ColorIndex = 240 ' = redish
- acBlkTblRec.AppendEntity(acRegion)
- acTrans.AddNewlyCreatedDBObject(acRegion, True)
- 'solidObj.SetDatabaseDefaults()
- 'solidObj.Extrude(CType(myRegionColl(0), Region), 1.0, 0.0)
- solidObj.Extrude(acRegion, 1.0, 0.0)
- ' Add the new object to the block table record and the transaction
- 'acBlkTblRec.AppendEntity(solidObj)
- ' end make region
|