TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Lupo76 on October 21, 2015, 09:00:04 AM
-
Hi everyone,
I have to do work for a client who uses AutoCAD Architecture.
The work is quite simple: count the blocks in the drawing.
For objects INSERT I have no problem, as identification code can use the name of the block.
But in these drawings I must also count "AEC_MVBLOCK_REF" and "AEC_WALL" :cry:
With the following code I see all the characteristics of these objects:
(defun c:propogg (/ obj vlaobj)
(vl-load-com)
(setq obj (car (entsel)))
(setq vlaobj (vlax-ename->vla-object obj))
(vlax-dump-object vlaobj T)
)
However I can see them only with AutoCAD Architecture, while with AutoCAD Full / BricsCAD I can see only the generic characteristics.
There is some way to get more information (eg, stylename for objects AEC_MVBLOCK_REF, using AutoCAD Full (no Architecture) and/or BricsCAD?
-
Perhaps there is xdata on the objects you could use?
-
What does this program (http://www.lee-mac.com/entitylist.html) return for the object?
-
What does this program (http://www.lee-mac.com/entitylist.html) return for the object?
Here is the result:
Comando: EE
Selezionare oggetto:
(
(-1 . <Nome entità: 7ff6b182a950>)
(0 . "AEC_MVBLOCK_REF")
(330 . <Nome entità: 7ff6b18069f0>)
(5 . "23ABD")
(100 . "AcDbEntity")
(67 . 0)
(410 . "Model")
(8 . "A780G")
)
Comando:
Comando: *Annullato*
Comando: *Annullato*
Comando: EEX
Selezionare oggetto:
(
(-1 . <Nome entità: 7ff6b182a950>)
(0 . "AEC_MVBLOCK_REF")
(330 . <Nome entità: 7ff6b18069f0>)
(5 . "23ABD")
(100 . "AcDbEntity")
(67 . 0)
(410 . "Model")
(8 . "A780G")
)
-
Can you post a dwg?
-
Perhaps there is xdata on the objects you could use?
How do I know?
I can use the following function:
(defun soloXdata (ent nameapp / elist exlist)
(setq elist (entget ent (list nameapp)))
(setq exlist (assoc -3 elist))
)
but what needs to put in place of "nameapp"?
-
Can you post a dwg?
here it is
-
Lee's code already takes care of that:
-
Lee's code already takes care of that:
(entget (car (entsel)) '("*"))
Selezionare oggetto: ((-1 . <Nome entità: 7ff6b19256c0>) (0 . "AEC_MVBLOCK_REF") (330 . <Nome entità: 7ff6b19069f0>) (5 . "23AC4") (100 . "AcDbEntity") (67 . 0) (410 . "Model") (8 . "A787G"))
:cry:
-
This might help:
-
This might help:
Ok, here's some more information, and I can see the name of the blocks stored in the entity
(
(-1 . <Nome entità: 7ff6b190f860>)
(0 . "DICTIONARY")
(5 . "DF1E")
(102 . "{ACAD_REACTORS")
(330 . <Nome entità: 7ff6b19068c0>)
(102 . "}")
(330 . <Nome entità: 7ff6b19068c0>)
(100 . "AcDbDictionary")
(280 . 0)
(281 . 1)
(3 . "M_DFURN_PLANT_3D Plant - A")
(350 . <Nome entità: 7ff6b19251e0>)
(3 . "M_KIT_APPL_Refrigerator Unit")
(350 . <Nome entità: 7ff6b19245e0>)
(3 . "M_OFURN_CHR_3D Secretary Chair")
(350 . <Nome entità: 7ff6b19230c0>)
(3 . "M_OFURN_CONF_3D Conference Table")
(350 . <Nome entità: 7ff6b19242c0>)
(3 . "M_OFURN_OFF_3D Computer")
(350 . <Nome entità: 7ff6b19234e0>)
(3 . "M_OFURN_OFF_3D Typewriter")
(350 . <Nome entità: 7ff6b1923c70>)
)
However I can not use that information to figure out how many chairs and how many plants there are in the DWG file.
I have to count how many multi-view blocks (AEC_MVBLOCK_REF) there are, considering blocking visible (chair or plant or whatever).
-
You can see more info with List command but...
Comando: LISTA
Selezionare oggetti: trovato(i) 1
Selezionare oggetti:
AEC_MVBLOCK_REF Layer: "A780G"
Spazio: Spazio modello
Gestore = 23abd
Inserimento : (12701.5535, -3687.1252, 46)
Rotazione : 181
Normale : (0, 0, 1)
Annotazione : No
Scala :
X = 400
Y = 450
Z = 440
Riferimento blocco : M_OFURN_CHR_3D Secretary Chair (Office Furniture: Chairs: 3D Secretary chair)
-
You can see more info with List command but...
Yes, I have seen.
But how can I derive this information with lisp?
reference block : M_OFURN_CHR_3D Secretary Chair (Office Furniture: Chairs: 3D Secretary chair)
and the derivation of these?
Wall style : Pannello 300 Bifacciale (Standard)
Base height : 3000
Fixed width : 40
Length : 1000