AutoCAD Architecture Customization

AutoCAD Architecture Customization

Reply
Valued Mentor
mdhutchinson
Posts: 2,317
Registered: ‎11-18-2003
Message 1 of 3 (428 Views)
Accepted Solution

Acces Property Data this works but...

428 Views, 2 Replies
02-05-2013 02:50 PM

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

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

Valued Contributor
Chris.Picklesimer
Posts: 91
Registered: ‎04-07-2000
Message 2 of 3 (413 Views)

Re: Acces Property Data this works but...

02-06-2013 11:13 AM in reply to: mdhutchinson

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

Valued Mentor
mdhutchinson
Posts: 2,317
Registered: ‎11-18-2003
Message 3 of 3 (404 Views)

Re: Acces Property Data this works but...

02-07-2013 08:22 AM in reply to: Chris.Picklesimer

That works. Thanks!

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!