
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
i need help. i use autodesk autocad 2016
I have a 3d solid , Solid type = Box, i use command CMATERIAL and chose material name is "Layer_M7" ( i have this material in my drawing) i use command MATERIALASSIGN to assingn this meterial to my box ; then i type CMATERIAL again and chose material name is "Layer_M2" i use command MATERIALASSIGN to assingn this meterial to one face of this box ( a box have 6 face).
when i type LIST command and chose this Box, i have a result .
Command: LIST
Select objects: 1 found
Select objects:
3DSOLID Layer: "bemat"
Space: Model space
Material: Layer_M7
Handle = af4
Face1 Material = Layer_M2
History = None
Show History = No
Bounding Box: Lower Bound X = -27.8004 , Y = 31.6771 , Z = 0.0000
Upper Bound X = 78.9335 , Y = 138.3119 , Z = 202.3191
My problem is : i want to get the material name by lisp, include Material:Layer_M7 and Face1 Material = Layer_M2.
I have used this code :
(vl-load-com)
(defun c:getmaterialname ()
(setq acadObj (vlax-get-acad-object))
(setq doc (vla-get-ActiveDocument acadObj))
(setq K (Ssget))
(setq textObj (ssname K 0))
(setq textObj (vlax-ename->vla-object textObj))
(setq m1
(VLA-GET-material textObj))
(alert m1)
)
It is Ok , but it get the name Material: Layer_M7 only;
i want to use Autolisp to get Face1 Material in that box, could anyone help me? Thanks alot.
Solved! Go to Solution.