AutoCAD Architecture Customization
Welcome to Autodesk’s AutoCAD Architecture Customization Forums. Share your knowledge, ask questions, and explore popular AutoCAD Architecture Customization topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Acces Property Data this works but...

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
mdhutchinson
803 Views, 2 Replies

Acces Property Data this works but...

This code works... so long as the PropertySet is not style based.

Is there a way around this?

 

(setq vlaObj (vlax-ename->vla-object (car (entsel "Select a Object ")))
 acadObj    (vlax-get-acad-object)
 schedApp   (vla-getInterfaceObject
                acadObj
                "AecX.AecScheduleApplication.7.0"   ; for AutoCAD MEP 2013
             )
 propSets (vlax-invoke-method schedApp 'PropertySets vlaObj)
 psdName "MvPartCustom_TypeStyles"
 propSet (vlax-invoke-method propSets 'Item psdName)
 properties (vlax-get-property propSet 'Properties)
propNameValList (reverse
(vlax-for prop properties
  (setq propNameValList
    (cons
      (cons
        (vlax-get-property prop 'Name)
        (vlax-variant-value
          (vlax-get-property prop 'Value)
        )
      )
      propNameValList
    )
  )
)
)
)

2 REPLIES 2
Message 2 of 3

What if you get the Style Object (StyleObj) and look for propsets on that instead of the selected object?

I tried on my end and I was able to get the style based prop set list.

 

Chris

 

 

(setq vlaObj (vlax-ename->vla-object (car (entsel "Select a Object ")))

StyleObj (vlax-get vlaObj 'Style);<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<Modified
acadObj    (vlax-get-acad-object)
schedApp   (vla-getInterfaceObject
                acadObj
                "AecX.AecScheduleApplication.7.0"   ; for AutoCAD MEP 2013
             )
propSets (vlax-invoke-method schedApp 'PropertySets StyleObj);<<<<<<<<Modified
psdName "MvPartCustom_TypeStyles"
propSet (vlax-invoke-method propSets 'Item psdName)
properties (vlax-get-property propSet 'Properties)
propNameValList (reverse
(vlax-for prop properties
  (setq propNameValList
    (cons
      (cons
        (vlax-get-property prop 'Name)
        (vlax-variant-value
          (vlax-get-property prop 'Value)
        )
      )
      propNameValList
    )
  )
)
)
)

Message 3 of 3

That works. Thanks!

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

Post to forums  

Autodesk Design & Make Report

”Boost