#1
|
|||
|
|||
BOM Table and ":pick_pnt"
I'm trying to create a lisp routine which automates the generation and drawing of the BOM. But I can't get the ":pick_pnt" action to work. The BOM is directly placed in the drawing at an undefined place but I need the BOM table at my mouse point so I can place it where I want.
Code:
:ok-action '(let (probe) (when (sd-call-cmds (am_bom_scan3d :assy assembly)) (sd-call-cmds (am_bom_numbers :by_step :update)) (sd-call-cmds (am_bom_draw :bom_layout "BOM" :dir_up :lower_left :update_buttons :draw_bom :pick_pnt)) (sd-call-cmds (am_bom_update)) ) ;end when ) ;end let |
#2
|
||||
|
||||
Re: BOM Table and ":pick_pnt"
Hello Rara,
It would be a little bit more helpful to answering your question if you could supply the whole lisp routine. So people could see how your specifing the ":pick_pnt". Cheers Thom |
#3
|
||||
|
||||
Re: BOM Table and ":pick_pnt"
This is how it works for me:
AM_BOM_DRAW :bom_layout "Company" :dir_up :lower_left :draw_bom -620,370 complete you need to specify a coordinate *where* to place your bom. You specified just a keyword. But you have to specifzz the *value* vor the variable, too. so .. Code:
(am_bom_draw :bom_layout "BOM" :dir_up :lower_left :update_buttons :draw_bom :pick_pnt 200,42)) HTH |
#4
|
|||
|
|||
Re: BOM Table and ":pick_pnt"
I understand that Wolfgang but is it possible to get the table at the mouse point so I can place it at a random position. When I give up a coordinate it only works for one drawing type. The different drawing types have different values (coordinates) for the table positions.
@Thom: The first part of the routine didn't seem relevant to me noticing but I wil put the complete routine down: Code:
(in-package :mybom) (use-package :oli) (when (not (sd-module-active-p "ANNOTATION")) (sd-display-warning "Please load Annotation!") (cancel_all) ) ;; end when ;; Actiondialog (sd-defdialog 'bom-partlist :module "ANNOTATION" :toolbox-button t :dialog-title "BOM Table" :precondition '(if (docu::docu-inq-highest-sheet-name) :ok (values :error "Please load drawing!") ) ;; end if :variables '( (ASSEMBLY :selection (*sd-assembly-seltype*) :title "Assembly" ) );variables end :ok-action '(let (probe) (when (sd-call-cmds (am_bom_scan3d :assy assembly) (sd-call-cmds (am_bom_numbers :by_step :update) (sd-call-cmds (am_bom_draw :bom_layout "BOM" :dir_up :lower_left :update_buttons :draw_bom :pick_pnt) (sd-call-cmds (am_bom_update) ) ;end when ) ;end let ) Last edited by Rara; 04-25-2005 at 12:15 AM. |
#5
|
||||
|
||||
Re: BOM Table and ":pick_pnt"
Quote:
1st remark: if you just create a new bom table you do not need the am_bom_update, because your NEW bom is already up to date. 2nd remark If you are using your dialog only in interactive mode (so not calling yours via sd-call-cmds) the following will work for you: PHP Code:
|
#6
|
|||
|
|||
Re: BOM Table and ":pick_pnt"
Quote:
|
#7
|
||||
|
||||
Re: BOM Table and ":pick_pnt"
That's fine that we found a solution..
No, I did not try the routine, just wrote it. here's another example: (AM_BOM_NUMBERS :by_step :on :by_step_incr 19) I think the ':on' is missing in your code. Do it once again manually, and use the recorder.. I assume the :on is in there. |
#8
|
|||
|
|||
Re: BOM Table and ":pick_pnt"
Yes it is. I coppied the whole command ":on complete" like it showed me in the recorder but it seems the "complete" should be left out. Well it works now so thanks for the help Wolfgang.
|
#9
|
||||
|
||||
Re: BOM Table and ":pick_pnt"
Yes.. the complete is not needed here. When writing functions the complete found in a recorder file is replaced with a closing bracket (to say it in simple words).
May be you can find some more hints in: http://www.clausbrod.de/cgi-bin/view.pl/Osdm/MacroModelClipping which explains the 'migration' from a recorderfile to a lisp function. But since you are already using things like sd-call-cmds and sd-defdialog that example might be too simple.. ? |
#10
|
|||
|
|||
Re: BOM Table and ":pick_pnt"
Can anyone explain where to find the help document for the command:
am_bom_draw? I tried this command as following: (am_bom_draw :bom_layout "BOM" :dir_up :lower_left :update_buttons :draw_bom ick_pnt -100, 60)) But got an error message "There is no loaded layout with this name.". Which layout name should I give? I used the following codes to set the layout name but got the same error message: (setf assem_obj (sd-pathname-to-obj assem_path)) (setf layouts (sd-inq-part-layouts assem_obj)) (setf layout_name (sd-inq-obj-pathname (nth 0 layouts))) (sd-call-cmds (am_bom_draw :bom_layout layout_name :dir_up :lower_left :update_buttons :draw_bom ick_pnt -100,60)) Thanks, Xiaoming |
#11
|
||||
|
||||
Re: BOM Table and ":pick_pnt"
your 're mixing up two expressions using the same word.
looking into help: "sd-inq-part-layouts Returns the list of all layouts owned by the specified part or assembly." This function (which was new to me) is talking about layouts which are view sets and views of a part/assembly. This is what Annotation is doing today. Those kind of layouts were the only way (AFAIK) to get a drawing of your part before Annotation was born. A BOM layout is the outlook of your bom table and bom flags. e.g. :bom_layout "DIN" or :bom_layout "ISO" open AM_BOM_DRAW and use it interactively. Look to the drop down list next to the 'Layout' button. These are the names of BOM-layouts you can use. By default 'DIN', 'ISO' and 'Company' are available. You can create your own and register them via am_customize during startup. |
#12
|
|||
|
|||
Re: BOM Table and ":pick_pnt"
Hello Wolfgang,
Thank you very much. It works. Is there any help documents for such commands? I searched but couldn't find. Thanks again, Xiaoming |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | Search this Thread |
Display Modes | Rate This Thread |
|
|