ACA-AMEP: Edit Property Data Via AutoLISP, Part 2

First article in the series.

In the previous article, we obtained a collection of the Property Sets on the object for which we want to change the value of a Property. We also determined the total number of Property Sets in the collection, and set up a Property Set counter, initialized to 0, the index of the first Property Set. The following code assumes that you know not only the name of the Property that is to be changed, but also the name of the Property Set in which it resides and that the name is stored in a variable called sPSet.

(while (< iPSet iPSets)  ; While unprocessed Property Sets remain...
(setq oPSet (vlax-invoke-method oPSets 'Item iPSet) ; Get current Property Set object.
sPSetNm (vlax-get-property oPSet 'Name) ; Get Property Set name.
) ;_ End setq.
(if (= (strcase sPSetNm) (strcase sPSet)) ; If target Property Set is found...
(setq iPSet (1+ iPSets)) ; ...exit while loop.
(setq iPSet (1+ iPSet)) ...

Read more