.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Reply
Message 1 of 4
Anonymous
194 Views, 3 Replies

Block Name

I have iterated thru collected a list of all the nested blocks in a block. My question is how do you capture the block names of the nested blocks?

There is no name property of the blockreference.

thanks

pat
3 REPLIES 3
Message 2 of 4
Anonymous
in reply to: Anonymous

Dim btr As AcDb.BlockTableRecord = tr.GetObject(BlockID,
AcDb.OpenMode.ForWrite)
btr.Name

Where tr is Transaction, and AcDb is Autodesk.AutoCAD.DatabaseServices

tp

escreveu na mensagem
news:5399887@discussion.autodesk.com...
I have iterated thru collected a list of all the nested blocks in a block.
My question is how do you capture the block names of the nested blocks?

There is no name property of the blockreference.

thanks

pat



I'm protected by SpamBrave
http://www.spambrave.com/
Message 3 of 4
Anonymous
in reply to: Anonymous

I rectify. To get the name it can be ForRead

Dim btr As AcDb.BlockTableRecord = tr.GetObject(BlockID,
AcDb.OpenMode.ForRead)
btr.Name

Where tr is Transaction, and AcDb is Autodesk.AutoCAD.DatabaseServices

tp

escreveu na mensagem
news:5399887@discussion.autodesk.com...
I have iterated thru collected a list of all the nested blocks in a block.
My question is how do you capture the block names of the nested blocks?

There is no name property of the blockreference.

thanks

pat



I'm protected by SpamBrave
http://www.spambrave.com/



I'm protected by SpamBrave
http://www.spambrave.com/
Message 4 of 4
Anonymous
in reply to: Anonymous

i get a warning of not able to cast a blockreference to a blocktablerecord, here is a snippet of my code

Private Sub DynamicLabels(ByRef BlkRefID As ObjectId, ByVal objPanelTag As Object, ByRef Trans As Transaction)
Dim btr As BlockTableRecord = Trans.GetObject(BlkRefID, OpenMode.ForRead)



Dim control As Object

For Each control In Me.grpDynamic.Controls
If TypeOf control Is Panel Then
Dim PanelTemp As Panel
PanelTemp = CType(control, Panel)
If PanelTemp.Tag = objPanelTag Then
Dim lblDynamicName As New Label
Dim lblDynamicDescription As New Label
Dim lblDynamicValue As New Label
Dim lblPanelName As New Label
PanelTemp.Controls.Add(lblPanelName)
lblPanelName.Left = (380 / 2) - (lblPanelName.Width / 2)
lblPanelName.Top = 5
lblPanelName.Width = 100
lblPanelName.Height = 15
lblPanelName.Text = "Block Name = " & btr.Name
lblPanelName.TextAlign = Drawing.ContentAlignment.MiddleCenter

PanelTemp.Controls.Add(lblDynamicName)
lblDynamicName.Left = 5
lblDynamicName.Top = 20
lblDynamicName.Width = 100
lblDynamicName.Height = 15
lblDynamicName.Text = "Name"
lblDynamicName.TextAlign = Drawing.ContentAlignment.MiddleCenter

PanelTemp.Controls.Add(lblDynamicDescription)
lblDynamicDescription.Left = 150 - (lblDynamicDescription.Width / 2)
lblDynamicDescription.Top = 20
lblDynamicDescription.Width = 100
lblDynamicDescription.Height = 15
lblDynamicDescription.Text = "Description"
lblDynamicDescription.TextAlign = Drawing.ContentAlignment.MiddleCenter

PanelTemp.Controls.Add(lblDynamicValue)
lblDynamicValue.Left = 250 - (lblDynamicValue.Width / 2)
lblDynamicValue.Top = 20
lblDynamicValue.Width = 150
lblDynamicValue.Height = 15
lblDynamicValue.Text = "Value"
lblDynamicValue.TextAlign = Drawing.ContentAlignment.MiddleCenter
End If
End If
Next

End Sub

this is how I am calling my "Trans"
Using DB As Database = HostApplicationServices.WorkingDatabase
Using Trans As Transaction = DB.TransactionManager.StartTransaction()

thanks

pat

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

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost