VBA
Discuss AutoCAD ActiveX and VBA (Visual Basic for Applications) questions here.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Explode block, then add previous to Selection set

8 REPLIES 8
Reply
Message 1 of 9
coreyN
256 Views, 8 Replies

Explode block, then add previous to Selection set

Is there a way to explode a block, then use previous to add what was in the block to a selection set. Is there another way other then using the send commmand? Thanks for any advice.
8 REPLIES 8
Message 2 of 9
NathTay
in reply to: coreyN

The explode method returns the entities.

Regards - Nathan
Message 3 of 9
coreyN
in reply to: coreyN

I did some searches on the explode method and tried some of the ideas. Is there a way to get around the copied block, or is it easier to use object.delete?
Message 4 of 9
NathTay
in reply to: coreyN

Yes, just use the delete method if you do not need the original block.

Regards - Nathan
Message 5 of 9
coreyN
in reply to: coreyN

my last question, when I run this simple code, I goto command line and type "move" Previous nothing is selected. I am hoping to select previous for a selection set. Is my process way off?

Sub BlockProperties()

Dim Block As AcadBlockReference
Dim ReturnObj As AcadObject
Dim pt As Variant

GetEnt:
ThisDrawing.Utility.GetEntity ReturnObj, pt, "Select Block: "


If ReturnObj.ObjectName <> "AcDbBlockReference" Then

MsgBox "Selected object is not a proper block!", vbExclamation
GoTo GetEnt

End If

Dim explodedObjects As Variant
explodedObjects = ReturnObj.Explode

ReturnObj.Delete

End Sub
Message 6 of 9
arcticad
in reply to: coreyN

This should work but it doesn't anyone know why?

ThisDrawing.ActiveSelectionSet.Clear
ThisDrawing.ActiveSelectionSet.AddItems explodedObjects
ThisDrawing.ActiveSelectionSet.Update
---------------------------



(defun botsbuildbots() (botsbuildbots))
Message 7 of 9
coreyN
in reply to: coreyN

At risk of sounding very lost, I am trying to get items from a block "text". I read that it can be done with with Explode Method and I also see Item Method. Would some body be able to provide a simple example for me to break down myself. A simple block with a piece of text and a user form to view the text from the block.
Message 8 of 9
Bryco
in reply to: coreyN

A block w/ text, interesting.
The block (not the blockreference) has all the text in it. Cycle through the entities within the block, check for type text or mtext, then grab the .TextString property to have the text
Message 9 of 9
coreyN
in reply to: coreyN

It might sound like I am doing it the hard way, But I am using the text with a opaque background hatch. The hatch will change with the length of text.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost