Jump to content

Property sets for styles in Acad Architecture


mickbradford

Recommended Posts

Hi there,

I've seen plenty of great VBA code in this forum so far that interrogates and retrieves attributes for AutoCad blocks. That works great but a division within my company uses AutoCad architecture... and therefore uses MultiView blocks for labelling up rooms etc instead of AutoCad blocks.

 

We can extract geospace parameters from mvBlocks like room name or department (using the code below), but we now need to extract property set values attached to the style - but all attempts return no recordset for the style - We're looking for some of the standard values like length, area etc...

 

Can anyone help?

 

Many thanks in advance,

Mick

 

Code:

Public Sub TestCode()

Dim SchedApp As New AecScheduleApplication

Dim Ent As AcadEntity

Dim Pt As Variant

Dim Geo As AecGeo

Dim Anchor As AecAnchorExtendedTagToEnt

Dim RefObj As AcadEntity

Dim Propset As AecSchedulePropertySet

Dim cProps As AecScheduleProperties

Dim oProp As AecScheduleProperty

ThisDrawing.Utility.GetEntity Ent, Pt, "Select Block Ref"

If TypeOf Ent Is AecMVBlockRef Then

 

If TypeOf Ent Is AecGeo Then

Set Geo = Ent

Set Anchor = Geo.GetAnchor

End If

 

Set RefObj = Anchor.Reference

 

Set cPropSets = SchedApp.PropertySets(RefObj)

'can the above line work with ent.style in the brackets?

'It only returns 0 property set count

If cPropSets.count > 0 Then

Set Propset = cPropSets.Item(0)

Set cProps = Propset.Properties

For Each oProp In cProps

MsgBox oProp.Name & " = " & oProp.Value

Next

Else

MsgBox "There are no properties for this object"

End If

End If

End Sub

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...