• This forum is the machine-generated translation of www.cad3d.it/forum1 - the Italian design community. Several terms are not translated correctly.

density 1

  • Thread starter Thread starter mguerra
  • Start date Start date
ecco la macro
(in-package :custom)
(use-package :oli)

(sd-defdialog 'show_by_density

:dialog-title "visualizza per densita"
:toolbox-button nil
:variables
'(
(assy :value-type :assembly :modifies :nil :initial-value (sd-pathname-to-obj "/") :title "gruppo")
(wiseerst :value-type :boolean :toggle-type :wide-toggle :title "clear vp first" :initial-value t)
(mindens :value-type :number :initial-value 0.05 :title "min.densita")
(maxdens :value-type :number :initial-value 999999999 :title "max.densita")
(count_csn :initial-value nil :multiple-items t)
(tot :initial-value nil :multiple-items t)
(p-count :initial-value nil :multiple-items t)
(a-count :initial-value nil :multiple-items t)
(obj :modifies :nil)
(vis-risult :value-type :grouped-boolean :initial-value nil :title "lista densita")
("lista densita istanza")
(vis-risult_ist :value-type :grouped-boolean :initial-value t :title "lista istanza")
)

:local-functions
'(
(doit ()
(if wiseerst (clear_vp (oli:sd-inq-current-vp)) ())
;(setf assy (sd-pathname-to-obj "/"))
(setf tot (jb-inq-obj-tree-list assy))
(dolist (obj tot "done")
(setf vlag 0)
(setf partje (equal (sel_item-type obj) *sd-part-seltype*))
(setf sampje (equal (sel_item-type obj) *sd-assembly-seltype*))
(if (equal partje t) (setf vlag 1)())
(if (equal sampje t) (setf vlag 0)())
(if (equal vlag 1)
(progn
(setf dens (sd-inq-part-density obj))
(setf dens_ist (sd-inq-part-density obj :instance))
;;(display dens_ist)
;(display (sd-inq-obj-pathname obj))
(if (equal dens nil) (setf dens 0)())
(if (and (> dens mindens) (< dens maxdens)) (add_to_vp_drawlist (oli:sd-inq-current-vp) obj)())

(if vis-risult
(if (and (> dens mindens) (< dens maxdens))
(display (format nil "base = ~a : ~10f" (sd-inq-obj-basename obj) dens)))
t
);;if vis-risult

(if vis-risult_ist
(if (not (equal dens_ist nil))
(display (format nil "istanza = ~a : ~a" (sd-inq-obj-basename obj) dens_ist)))
t
);;if vis-risult_ist
)())
)
(fit_vp (oli:sd-inq-current-vp))
(update_screen)
)
)

;:mutual-exclusion
;'(assy)

:ok-action
'(doit)
:help-action '(sd-display-message "visualizza densita")
)


(defun jb-inq-obj-tree-list (obj)
(cons obj
(apply #'nconc
(mapcar #'jb-inq-obj-tree-list
(sd-inq-obj-children obj)
)
)
)
)
 
Thank you, how do I create the command?
or better where do I take the macro?


(I have version 17 of modeling)
 
I believe that to make a rotten enough simply:

- open a new text file
- copy and paste the text representing the macro
- save the .lsp file extension
- upload the file to osd.

the fact that you have the 17 is better also because many old lisp, if not mistaken, started to have problems from 18 onwards
 

Forum statistics

Threads
44,997
Messages
339,767
Members
4
Latest member
ibt

Members online

No members online now.
Back
Top