#1
|
|||
|
|||
Sheet Metal Tool Replacement macro?
Hi all,
I want our countersink stamp tools to show up on our flats with different hole sizes. For example: in 12 Ga steel (2.667 mm), a #10 countersink stamp has a top OD of 10.30 mm and a bottom OD of 5.68 mm (actual hole dimensions). The tool we use in sheet metal has a top OD of 10.00 mm and a bottom OD of 7.98 mm, so we'd like the flat to show the hole this way. In our drawing views, top/front/bottom/isometric we want the countersink to show 10.30mm/5.63mm. On the flat, we want the holes to show 10.0mm/7.98mm. I understand I can use replacement macros for this. I turn on the replacement feature with this code in my sheet metal shop file (ie, demoshop.lsp) (sha-enable-replacements) (sha-enable-stamp-replacement) I then include a ": REPLACEMENT-INFO" line below my countersink stamps, like so: : REPLACEMENT-INFO ("sha_replace_my_stamp {1} {2}" : HOLE_DIA : OUT_DIA) I now need to write the macro "sha_replace_my_stamp" and save it in \personality\SheetAdvisor\replacement_fncs. What language are these macros written in? Can anyone help me generate some simple code to replace the stamp in the flat? P |
#2
|
||||
|
||||
Re: Sheet Metal Tool Replacement macro?
I would start out by using the recorder to record the steps you have described above.
From that you might be able to create a lisp program. Also, you can post the results of the recorder file here. Regards Tom
__________________
Tom Kirkman Creo Elements/Direct 20.1 Dell Precision 3581 https://www.o-i.com |
#3
|
|||
|
|||
Re: Sheet Metal Tool Replacement macro?
Thanks Tom. I was able to create the replacement macro using good ol' trial and error using TRACE. Do you have any advice on my code?
DEFINE Sha_replace_my_stamp LET circle_center (INQ 101) LET tol 0.1 LET del_size (INQ 3) INQ_SELECTED_ELEM SELECT CIRCLES ALL CONFIRM LOOP EXIT_IF (INQ 14=0) LET Up_limit ((INQ 3) + tol) LET Lw_limit ((INQ 3) - tol) IF ((del_size<=Up_limit) AND (del_size>=Lw_limit)) DELETE POINTER (INQ 2) END END_IF INQ_NEXT_ELEM END_LOOP LET del_size 0 CIRCLE (circle_center) END_DEFINE |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | Search this Thread |
Display Modes | Rate This Thread |
|
|