Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X
The sd-inq-part-density command can be modified to find the density of the contents, instance or realized. However; I cannot get the kind option to work.
I added this to a lisp
(sd-inq-part-density part (kind :contents))
but this does not work. With out the (kind :contents) it works find.
Any suggestions?
Below is copied from the help in Version 19.1.
(sd-inq-part-density part &optional (kind :realized))
Solved! Go to Solution.
This is what I typed in on my command line which worked:
(display (oli:sd-inq-part-density (oli:sd-inq-curr-part) :realized))
I don't know if you included the "(kind :contents)" exactly like that or not. The way the syntax is described for this command appears to be different than how it is written for other commands; the "()" and the work "kind" should not be included.
This is what I typed in on my command line which worked:
(display (oli:sd-inq-part-density (oli:sd-inq-curr-part) :realized))
I don't know if you included the "(kind :contents)" exactly like that or not. The way the syntax is described for this command appears to be different than how it is written for other commands; the "()" and the work "kind" should not be included.
(sd-inq-part-density part &optional (kind :realized))
is the correct LISP syntax description of this function
the &optional means that the second argument can be omitted - and in that case the default value is taken for
the second argument. This is standard LISP convention. In fact, if you are writing your own function, that is exaclty the way to define it in LISP:
(defun my-own-part-densitity part &optional (kind :realized)
(when (eq kind :realized)
,,,,,,
)
)
The way Pete used (called) this function is correct.
The syntax as described in the manual is also correct.
I found the issue, it actually had nothing to do with this command, but the way I was formatting the result. I was looking for a number, and if the results were nil I would get an error. I had some instance density set to None.