CoCreate User Forum  

Go Back   CoCreate User Forum > Applications > CoCreate Modeling

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old 09-20-2018, 08:35 AM
phi phi is offline
Registered User
 
Join Date: May 2018
Posts: 5
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
Reply With Quote
  #2  
Old 09-25-2018, 05:15 AM
tom kirkman's Avatar
tom kirkman tom kirkman is offline
Registered User
 
Join Date: Oct 2002
Location: Perrysburg, Ohio
Posts: 393
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 19.0
DELL Precision 7510
Reply With Quote
  #3  
Old 09-25-2018, 02:52 PM
phi phi is offline
Registered User
 
Join Date: May 2018
Posts: 5
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
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 10:26 AM.



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 - 2021, Jelsoft Enterprises Ltd.