/* by iri - calculate the number of polygons */ /* I don't know if the result is correct .... */ /* add one instance of this plug, clic on "Count", read the number and Cancel (or Delete this instance) */ typeof class = S;; typeof ed = PluginEditor;; typeof resultat = ObjText;; /* MainEdit3d.lsoE3d : list of H3d in the ObjTree (tab Objects in the editor) MainEdit3d.s3dE3d : session 3d see also 'e3dmng.pkg' */ fun _countPoly(btn, u)= let 0 -> i in let 0 -> compteur in (while i <= (sizelist MainEdit3d.lsoE3d) do let nth_list MainEdit3d.lsoE3d i -> [h3d _] in let M3listOfPolygons MainEdit3d.s3dE3d h3d -> mylist in (set compteur = compteur + sizelist mylist; set i=i+1); _ADDtext resultat itoa compteur); 0;; fun openedit(win, param) = let _GETwindowSizePosition win -> [w h x y] in ( set ed = startPluginEditor _channel win 0 0 w h WN_CHILDINSIDE|WN_NOBORDER class; _CBbutton _CRbutton _channel ed.PluginEditorEditWin 5 5 80 20 0 "Count" @_countPoly 0; _CRtext _channel ed.PluginEditorEditWin 5 30 200 20 ET_ALIGN_LEFT "Calculate the number of polygone"; set resultat = _CRtext _channel ed.PluginEditorEditWin 5 55 100 20 ET_BORDER "Result : "; 0 );; fun IniPlug(file) = set class=getInfo strextr _getpack _checkpack file "name"; PlugRegister class nil nil @openedit nil ;;