

(setq idx (1+ idx) get next solid in the selection set. call the QF command with the 2 arguments ! SolVol (vlax-get (vlax-ename->vla-object solEnt) 'Volume) find its volume (while (vla-object solEnt) 'Centroid) find its centroid Idx 0 set the index to the first entity in the selection set (defun c:QF () (LM:QuickField "Volume" "%lu2%ps" 2)) define locally the Lee-Mac function as a command ! (defun c:FCS ( / idx ssol solEnt solCentroid solVolSum QF) You get also the SUM of the Volumes at the command line.Įnjoy. You can loop through a selection set of solids and place a field and Sphere at the centroid ! IAcad3DSolid 58df56f0 : TeighaX Interface of a solid object with free-form surface support In the case of a 3Dsolid you get the following Informations : : (vlax-dump-object (vlax-ename->vla-object (car(entsel))) T) (vlax-get (vlax-ename->vla-object (car(entsel))) 'Required Property )
AUTOCAD LISP ENTSEL NIL CODE
Just substitute the required property in the following code The code provided is Lisp code and you can automate your projects, by specifying tasks and targets in detail !Īs you can see Centroid and Volume are just 2 of 34 properties You can also look at the following links for more informations (vlax-dump-object (vlax-ename->vla-object (car (entsel ))) T) You can use the following code in the command line to get a list of Properties and functions of ANY entity in Bricscad (setq c (UpdateAssocListByIndex 300 "F200" 4 b)) see modification.(vlax-get (vlax-ename->vla-object (car(entsel))) 'Volume) (UpdateAssocListByIndex key NewValue index InputList) (subst (cons key NewValue) (cons key OldKeyValue) InputList)

(defun UpdateAssocListBykeyValue (key NewValue OldKeyValue InputList / index)
AUTOCAD LISP ENTSEL NIL UPDATE
This function update List by Old Key value. InputList input list to run lambda loop for each element in InputList

X x this act as output to lambda function X (cons key NewValue)) if index zero then add list with new value and lower index (if (= (car x) key) check if current key is equal to inout key (setq index (if (or (= nil index) (= "" index) ) 1 index)) change 0-1 Change on 21-09-218 By Dinesh Pawar to remove bug if index input is nil or blank string set index value to 1 if input is nil or empty string (defun UpdateAssocListByIndex(key NewValue index InputList / index) This function Update Associative list by index New Function To change associate list. This function included into your code as below. Update associative list on the basis of OldValue. Update associative list on the basic of Index.Ģ. Here I am write two function which can helpful to change associative list.ġ. please check possibility of index change.

I appreciate it :)Īs per your problem here I have doubt to updating associative list on the basis of index because, some time we can't predict exact index position. (setq c (subst (cons 300 "F200") (assoc 300 b) b)) Trying to update and change the Label Property (setq a (car (entsel "\nSelect a object: "))) I have created the following code: But how can I choose a index? and get DXF I want. Here I want to change the DXF 300 at index 4 (300. I get the following list, with the command (entget (car (entsel))): ((-1. I'm struggling with changing the right DXF, there is 9 DXF of 300.
