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

problem lisp

  • Thread starter Thread starter micgiul
  • Start date Start date

micgiul

Guest
Hello everyone!

I have problems with the lisp I can't fix.

I found on a site a lisp program, to view additional fields on the structure list.

Now I wanted to add my fields for example the weight of the part, once you notice the density.

I then copied the code and wrote the following function:

(defun browser-display-contents-weight (node)
(let (node-item (sd-pathname-to-obj (browsernode-objpath node)))
(if (sd-inq-part-p node-item) (sd-inq-part-density node-item :instance))
(sd-call-cmds (get_vol_prop :for_part :part node-item :tol :percent_tol 10 :mass)
"n/a"
)
);
)

gives me error when it goes to evaluate this line (sd-call-cmds (get_vol_prop :for_part :part node-item :tol :percent_tol 10 :mass)).

It is not a syntax error like lack of relatives tells me that it cannot evaluate the code.
I press this line works in another lisp function, and it gives me the weight!

I don't know how I can do if you can help me thank you in advance.

Thank you.
Michael
 
from the structure list visualizes the aches of the part (see density) the weight makes me a little difficult to read it.
 
Andy-manager's answer put the flea in my ear... .

and then I forced the system a bit and found the solution that I attach the .lsp file.

practically load the new display table, and then from the tool menu launch the function "add weight" that once selected all parts with the selection menu (e.g. all root by clicking on recurrence) automatically calculates the weight note the density....

Functioncchia is a first step for me in the direction of understanding something lisp...

hello and I hope this file can help someone.
 

Attachments

hello shaba, since the first time you enjoyed my work, I managed to update the macro.

now also calculates weights.

I made a small check on my drawings (premitted with about 4000 items between parts and assemblies) and gives me an error below 1 per thousand compared with the weight that gives me the calculation function part!

and this time I feel satisfied.

Hi.
Michael
 

Attachments

Thank you!
I have 2 small requests:
Would you be able to write in the table the specific weight *1000?
therefore instead of 0.00786 => 7.86
and can you change the column title?
I would like to change "changeable" in "mod"
Thank you!
 

Attachments

  • Image4.webp
    Image4.webp
    2.8 KB · Views: 21
from the image you have you are not using the "my" macro.

If you want to do what you ask me or send me the macro file you're using... .

Hi.
Michael
 
There she is!
I tried to change it with little results
the problem is that I don't find the command documentation.. :
for example this "sd-create-column-definition"
on the help there is nothing
 

Attachments

as you see in the file, the word "changeable" is not there, you can see that it recalls some other browsers... But I didn't watch with attention the code...

instead I added the commands to multiply by 1000 the density and I made you a note with modified writing. . .

I hope I've solved this....

regarding the documentation is on the online guide...
Just that it's been a few months since I've been banging our noses and I hope sooner or later to figure out something more...

Hi.
Michael
 

Attachments

Thanks for the file!
I had also guessed to make the * 1000 but it made me mistake

:detail-config'(:contents-name :doc-uid-column :modifiable :contents-density :instance-density)

the "changeable" takes it from :modifiable

One should create a column weighted with "sd-create-column-definition"
so you can give the custom name
But I need inq command to tell me if the part or the group is editable.
a similar thing for what was done for :contents-density
 
but not having documentation.... :/

you find where explains the command "sd-create-column-definition"
I don't know
 
PHP:
(oli:sd-num-to-string (* (oli::sd-sys-to-user-units :density (sd-inq-part-density node-item :contents)) 1000))
even in your file was missing a bracket.
now

(excuse the triple post)
 
Sorry about the parentheses.. .

The information you're looking for... you will find in the online manual and integration kit, and find with a little patience everything you need.

Hi.
Michael
 
Did you update the macro?
custom_browser_views.lsp
I know you had to add it to give weight to groups and subgroups.
Tnx!
 
I've added weights for groups. the macro is not perfect but the result gives it.
I don't understand why you need a macro of this type since there is the special command that displays your weight.
for those who use model managers do not use it as on each unreserved part gives you an error.
upload it from >file>load>select the file in the folder. otherwise it gives you a mistake.
to use it select the components with a window, and select the groups from the structure.
 

Attachments

I don't understand why you need a macro of this type since there is the special command that displays your weight.
Thank you for the macro
Well sincerely having the weights in the structure is more comfortable
especially for my boss who uses it sporadically. . .

I am also trying other macros of the type, for example I found one that by weight only touching the object. .
 
I don't work.... the weight calculation.... modeling v.18
you know why
i.e. you don't really work the command calculates modeling weights or a separate lisp, I had one that found the parts with dexity 1 etc.
 
I don't work.... the weight calculation.... modeling v.18
you know why
It could be that some command became obsolete, honestly with the 18 I had not found big problems, which with the 19 I can't say, the lisp I used until the 18 did not work practically anymore.

to check is what it feels like to show you the various lines with the video results with the command (display (function you want to see))
 
for some lisp that worked until version 17, just add ":toolbox-button t"
at the beginning of the lisp

(sd-defdialog 'iwg-teil-mehrfach-eigenstaendig-dialog
:dialog-title "mehrfach eigenstaendig"
:toolbox-button t
;:dialog-control:sequential
 

Forum statistics

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

Members online

No members online now.
Back
Top