关于块引用移动出现的问题.......?????!!!!!!!
我用VB做CAD的编程,用块引用的MOVE方法移动块,然后用块引用的EXPLODE方法对块进行炸开,奇怪的是.有些块引用移动后能炸开,有些块引用移动后不能炸开.而移动前进行EXPLODE操作的话,都能炸开.在CAD2000中不存在这个问题,但在CAD2004和2005中存在这种问题?
哪位大侠帮忙解决一下,看看到底是什么问题? 不等比例的块引用VBA是不能炸开的,和移动没什么关系 是整体缩放的,没用XSCALE或YSCALE做过缩放 贴上你的代码看看 <BR> Call MoveLineBlockObject(BlockRef, ObjectLine, iDocIndex)<BR> <BR> BlockRef.Explode <BR> BlockRef.Delete
--------------------------------------------------------------------------<BR>Public Sub MoveLineBlockObject(ByVal BlockRef As AcadBlockReference, ByVal ObjectLine As TCollection, ByVal iIndexBlock As Integer)<BR> On Error Resume Next<BR>
Plb = ObjectLine.BlockLeftBottom<BR> Prt = ObjectLine.BlockRightTop<BR>
ScaleRT = ObjectLine.ScaleRightTop<BR> ScaleLB = ObjectLine.ScaleLeftBottom<BR> <BR> <BR> If ObjectLine.ObjectType = m_SillObject Then<BR> If (ObjectLine.SpecialObjType > 0) And (ObjectLine.SpecialObjType Mod 2 = 0) Then<BR> pEndMove(0) = xBlockLeft + 800 - 200<BR> Else<BR> pEndMove(0) = xBlockLeft + 400 - 200<BR> End If<BR> pEndMove(1) = xBlockTop + 400 + 250<BR> Else<BR> pEndMove(0) = 1050<BR> pEndMove(1) = 1500 - ObjectLine.Height / 2 / dbScaleFactor<BR> End If<BR>
If (ObjectLine.ObjectType = m_NormalObject) And _<BR> (ObjectLine.SpecialObjType = m_NormalObjRectangle) Then<BR> Dim xInsertPoint As Variant<BR> xInsertPoint = BlockRef.InsertionPoint<BR> MoveBasePoint(0) = xInsertPoint(0)<BR> MoveBasePoint(1) = xInsertPoint(1)<BR> <BR> pEndMove(0) = xBlockLeft + 400<BR> pEndMove(1) = xBlockTop + 0<BR> ElseIf ObjectLine.ObjectType = m_NormalObject And ObjectLine.ColyModelLineObj.IsEspecialMdl Then<BR> MoveBasePoint(0) = (ScaleRT(0) + ScaleLB(0)) / 2<BR> MoveBasePoint(1) = ScaleLB(1) - 150<BR> Else<BR> MoveBasePoint(0) = (ScaleRT(0) + ScaleLB(0)) / 2<BR> MoveBasePoint(1) = ScaleLB(1)<BR> End If<BR>
If ObjectLine.ObjectType = m_ChiNoObject Then<BR> MoveChiNoObj ObjectLine, MoveBasePoint<BR> End If<BR>
<BR> ((((()))))<BR>
BlockRef.Move MoveBasePoint, pEndMove<BR> <BR>End Sub
我把EXPLODE放到引用的MOVE语句前就能炸开,位置在((((()))))处
其后就不行,对有些图形且是CAD2004,2005不行 你有QQ或MSN么?我们在那上面聊方便些 最好把你的图样(不能炸开的)贴上来 发现新问题,不能炸开和图形的位置有关.
我把块引用的插入点设成原点(0,0,0),把图形放到距离原点的不同位置.我在代码中是把块引用移动到原点附近位置,然后炸开.当图形原始位置距离原点位置近时,不存在炸不开的问题.当图形距离原点足够远时,块引用移动后炸不开.
该现象只存在于CAD2004,2005中,CAD2000中不存在该问题.不知这是怎么回事????
页:
[1]