Author Topic: Visualstyles & AutoLisp  (Read 2152 times)

0 Members and 1 Guest are viewing this topic.

HofCAD

  • Guest
Visualstyles & AutoLisp
« on: September 19, 2006, 02:51:37 AM »
Hello CAD friends,

I was wondering if anyone know if it is possible
to make visualstyles in AutoCAD 2007 with AutoLisp.

The next program list the visualstyles, but gives me more than I
was expecting.

Code: [Select]
(defun DicSTYLE_LIST (dicname / dics dic i NameList)
(defun tempList (theObject / item TmpName)
(setq theList '())
(vlax-for item theObject
(setq TmpName (vla-getname theObject item))
(setq theList (append (list TmpName) theList))
)
(setq theList (reverse theList))
);defun
(setq dics (vla-get-dictionaries (vla-get-Activedocument (vlax-get-acad-object))))
(setq dic (vla-item dics dicname))
(setq Namelist (tempList dic))
(setq i 0)
(repeat (length Namelist)
(setq DicObj (vla-GetObject dic (nth i Namelist)))
(setq DicEnt (vlax-vla-object->ename DicObj))
(print (entget DicEnt))
(setq i (1+ i))
)
)

(defun c:VisStyl()
(textpage)
(if (> (atoi (substr (getvar "ACADVER") 1 2)) 16)
(DicSTYLE_LIST "ACAD_VISUALSTYLE")
(princ "*****Works only in AutoCAD 2007+ *****"))
(terpri)
)
It gives me 2dWireframe, 3D Hidden, 3dWireframe, Basic, Brighten, ColorChange, Conceptual, Dim, Facepattern, Flat, FlatWithEdges,
Gouraud, GouraudWithEdges, Linepattern, Realistic and Thicken.
Why?
If the styles Flat, FlatWithEdges, Gouraud and GouraudWithEdges
exists, why can I not use them in the command SHADEMODE?

Thanks in advance!

Regards,
HofCAD CSI
« Last Edit: September 19, 2006, 02:10:29 PM by HofCAD »

gile

  • Gator
  • Posts: 2507
  • Marseille, France
Re: Visualstyles & AutoLisp
« Reply #1 on: September 19, 2006, 03:19:37 AM »
Hi,

You can use the VSEDGES sysvar for edges and the others VS* sysvars for others visual style displays.
Speaking English as a French Frog