Jump to content

VBA Changing a layer name within a block reference?


muck

Recommended Posts

AutoCAD 2000 up VBA.

 

I am trying to access block in order to change a layer name within them.

I have the coce:

 

Public Sub ListBlocks()

Dim objBlock As AcadBlock

Dim strBlockList As String

strBlockList = "List of blocks: "

For Each objBlock In ThisDrawing.Blocks

strBlockList = strBlockList & vbCr & objBlock.Name

Next

MsgBox strBlockList

End Sub

 

This code only gives the layer names. How do I change layer name/color within

a block using VBA. Also, is model and paper space considered to be a block within

the block collection?

 

Thank you,

Link to comment
Share on other sites

Based on the sample code, I’m not entirely clear on what the required task is. Are you trying to change the layer and colors of entities within the block? Or are you trying to change the layer in which the Block Insert resides?

 

 

Also, is model and paper space considered to be a block within

the block collection?

 

Thank you,

 

That is correct.

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...