Without knowing the rest of your situation, I see 2 problems that my arise.
The first being that if there is no layer 20 defined in your process model
you get an error when you identify it. A way around this is to make layer 20
the current active layer.
ON_LAYER[LY=20]
LAYER_GRP[AR=1, LY="20"]// remove L20 which is the X0Y0
Don't use the ADD_LAYER command for this. If the layer already exists you
will get an error. The ON_LAYER command will automatically add the layer if
it doesn't already exist. If no geometry is assigned to that layer it will
disappear at a later time.
The second situation would be if the macro requires that geometry exists on
layer 20. For this you need to build in an error check. You can use the
macro function GRP(0) to return the total number of elements in the current
group. Since you are removing only the elements on layer 20 you will
probably need to compare the count before and after.
#PrevCount=GRP(0)
LAYER_GRP[AR=1, LY="20"]// remove L20 which is the X0Y0
IF(GRP(0)=#PrevCount)
PAUSE[TX="No elements removed from group"]
ENDIF
=============================================
Fred Lauzus, CAM Programming Coordinator
High Steel Structures, Incorporated
mailto:[EMAIL PROTECTED] http://www.highsteel.com
=============================================
-----Original Message-----
From: Michael Senack [mailto:[EMAIL PROTECTED]]
Sent: Saturday, December 01, 2001 11:37 AM
To: '[EMAIL PROTECTED]'
Subject: [mfg-smartcam] Macro Error message
I just made a macro for a job.
The macro runs fine IF the shape file that is READ in by
the macro contains geometry on layer 20.
LAYER_GRP[AR=1, LY="20"]// remove L20 which is the X0Y0
The above line taken from the macro unselects all elements on layer 20.
When the macro is run and there is NO geometry on
layer 20 it generates an error and halts the macro.
Is there a way to do an error check on something like
this so the macro will not stop?
Regards,
Michael Senack
======================================================================
To find out more about this mailing list including how to unsubscribe,
send the message "info mfg-smartcam" to [EMAIL PROTECTED]
======================================================================
======================================================================
To find out more about this mailing list including how to unsubscribe,
send the message "info mfg-smartcam" to [EMAIL PROTECTED]
======================================================================