wbluem88 Posted February 8, 2010 Posted February 8, 2010 I want to place a block using a VBA routine, and then explode that block within the same routine. After a few searches on Google and this forum, it seems to be quite a pain to do. I was hoping someone had a solution. This code works fine everywhere else, but the block just will not explode. Dim varPoint As Variant Dim varArray As Variant Dim dblAngle As Double Dim objTrap As AcadEntity varPoint = ThisDrawing.Utility.GetPoint(, vbCr & "Select insertion point") dblAngle = ThisDrawing.Utility.GetAngle(varPoint, vbCr & "Select trap direction") objTrap = ThisDrawing.ModelSpace.InsertBlock(varPoint, "trapsink.dwg", varScale, varScale, 1, dblAngle) varArray = objTrap.Explode Quote
lpseifert Posted February 8, 2010 Posted February 8, 2010 First, is the block able to be exploded? I don't know if this works in VBA (it does in lisp) Try preceding the file name with an * Quote
fixo Posted February 9, 2010 Posted February 9, 2010 I want to place a block using a VBA routine, and then explode that block within the same routine. After a few searches on Google and this forum, it seems to be quite a pain to do. I was hoping someone had a solution. This code works fine everywhere else, but the block just will not explode. Dim varPoint As Variant Dim varArray As Variant Dim dblAngle As Double Dim objTrap As AcadEntity varPoint = ThisDrawing.Utility.GetPoint(, vbCr & "Select insertion point") dblAngle = ThisDrawing.Utility.GetAngle(varPoint, vbCr & "Select trap direction") objTrap = ThisDrawing.ModelSpace.InsertBlock(varPoint, "trapsink.dwg", varScale, varScale, 1, dblAngle) varArray = objTrap.Explode This is working for me: Set objTrap = ThisDrawing.ModelSpace.InsertBlock(varPoint, "trapsink.dwg", varScale, varScale, 1, dblAngle) varArray = objTrap.Explode objTrap.Delete ~'J'~ Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.