CoCreate User Forum  

Go Back   CoCreate User Forum > Support > Customization

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old 04-20-2005, 03:49 AM
Rara Rara is offline
Registered User
 
Join Date: Apr 2005
Posts: 13
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
Reply With Quote
  #2  
Old 04-20-2005, 07:03 AM
Thom Ivancso's Avatar
Thom Ivancso Thom Ivancso is offline
Registered User
 
Join Date: Oct 2002
Location: Connecticut, USA
Posts: 212
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
Reply With Quote
  #3  
Old 04-20-2005, 12:52 PM
Wolfgang's Avatar
Wolfgang Wolfgang is offline
Registered User
 
Join Date: Nov 2002
Location: ... near Sindelfingen near Stuttgart, Germany
Posts: 754
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
Reply With Quote
  #4  
Old 04-24-2005, 10:59 PM
Rara Rara is offline
Registered User
 
Join Date: Apr 2005
Posts: 13
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.
Reply With Quote
  #5  
Old 04-26-2005, 10:45 AM
Wolfgang's Avatar
Wolfgang Wolfgang is offline
Registered User
 
Join Date: Nov 2002
Location: ... near Sindelfingen near Stuttgart, Germany
Posts: 754
Re: BOM Table and ":pick_pnt"

Quote:
is it possible to get the table at the mouse point so I can place it
no, if you are using sd-call-cmds this is like opening-dialog-do-all-and-press-complete. So that function called can not become interactive in between.

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:
:ok-action
'(when (sd-call-cmds (am_bom_scan3d :assy assembly) 
     (sd-call-cmds (am_bom_numbers :by_step :update) 
    (sd-put-buffer "am_bom_draw :bom_layout \"BOM\" :dir_up :lower_left :update_buttons :draw_bom :pick_pnt")
  ) ;end when / ok-action 
so you are filling the command line and the user has finally to pick the position. Well, end-user can now also change the direction and other thinks again.. but my be it's ok.
Reply With Quote
  #6  
Old 04-26-2005, 11:20 PM
Rara Rara is offline
Registered User
 
Join Date: Apr 2005
Posts: 13
Re: BOM Table and ":pick_pnt"

Quote:
Originally Posted by Wolfgang
so you are filling the command line and the user has finally to pick the position. Well, end-user can now also change the direction and other thinks again.. but my be it's ok.
Yes this works fine for me Wolfgang thank you. Except for the "am_bom_numbers" (I get no error), I still have to add the numbering afterwards. Did you try the routine and if so, did the am_bom_numbers function in the routine work for you?
Reply With Quote
  #7  
Old 04-27-2005, 12:27 PM
Wolfgang's Avatar
Wolfgang Wolfgang is offline
Registered User
 
Join Date: Nov 2002
Location: ... near Sindelfingen near Stuttgart, Germany
Posts: 754
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.
Reply With Quote
  #8  
Old 04-28-2005, 04:53 AM
Rara Rara is offline
Registered User
 
Join Date: Apr 2005
Posts: 13
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.
Reply With Quote
  #9  
Old 04-28-2005, 02:30 PM
Wolfgang's Avatar
Wolfgang Wolfgang is offline
Registered User
 
Join Date: Nov 2002
Location: ... near Sindelfingen near Stuttgart, Germany
Posts: 754
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.. ?
Reply With Quote
  #10  
Old 08-10-2006, 10:11 PM
xiaoming xiaoming is offline
Registered User
 
Join Date: Aug 2006
Posts: 6
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
Reply With Quote
  #11  
Old 08-12-2006, 12:48 PM
Wolfgang's Avatar
Wolfgang Wolfgang is offline
Registered User
 
Join Date: Nov 2002
Location: ... near Sindelfingen near Stuttgart, Germany
Posts: 754
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.
Reply With Quote
  #12  
Old 08-13-2006, 10:24 PM
xiaoming xiaoming is offline
Registered User
 
Join Date: Aug 2006
Posts: 6
Smile 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
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 11:20 PM.



Hosted by SureServer    Forums   Modeling FAQ   Macro Site   Vendor/Contractors   Software Resellers   CoCreate   Gallery   Home   Board Members   Regional User Groups  By-Laws  

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
You Rated this Thread: