The attached sample macro will extract the text of a user commands and text
elements.

To use, enter the element number of the user command or text element when
prompted.

The macro will then group the identified element and do a "File - Print -
Data - Active Group - (to) File" creating an ASCII data file named
"TempFile.dat" containing the element data for just that one element.

The macro will then read in the data file and search for the word "Text" and
assigns the characters that follow to the string variable #UserText.


The PROMPT[] can be removed and another method can be used to identify the
element number. The macro can be automated and run from within another macro
using the MAC_EXE[] command. In the following example you may need to change
the path of the macro to match the location you run from.

STRING:#TestString

#ElNum=3

MAC_EXE[FN="C:\Sm9\Shared\Sysmcl\Get User Text.mcl"]

#TestString=STRTMP("#DOFF=1,#TOOL=1")

IF(STREQUAL(#UserText,#TestString)=1)

 MOD_UEVENT[EL=#ElNum, XS2=ENX(#ElNum), YS2=ENY(#ElNum),
TX=STRTMP("#DOFF=1,#TOOL=1,#V1=16,#V2=1"), LV=0]

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: Wednesday, April 24, 2002 10:11 AM
To: '[EMAIL PROTECTED]'
Subject: [mfg-smartcam] User_Elmt string help


I started this macro to change the contents of an User_Elmt's TX= string.

// Advanced_Wedm 11.5 Windows 10/16/98 16:48:10 Macro File
// w:\mcl\USEDCMD.mcl
// CREATED: 04/24/02
//  
//  This macro will changed the User_Elmt's TX string
//   from #DOFF=1,#TOOL=1 for Agie No.1 & 2  to
#DOFF=1,#TOOL=1,#V1=16,#V2=1 Agie No.3 & 4
//
//PAUSE[TX="The so far so good macro pause!", LR=10, LC=5, SR=2, SC=40,
PT=1]
VAR_REMOVE_ALL[]

STRING: #NO12TONO34
#NO12TONO34=#DOFF=1,#TOOL=1,#V1=16,#V2=1

MOD_UEVENT[EL=3, XS2=ENX(3), YS2=ENY(3), TX=STRTMP("%#NO12TONO34"), LV=0]

This works fine. 

What I'm interested in knowing is there a way to take the contents
of an existing User_Elmt's TX="" text string, put it in a string variable
and 
then check this string variable using an if test.

Maybe something to the effect of
IF #USERELMT=#DOFF=1,#TOOL=1 change it to
#USERELMT=#DOFF=1,#TOOL=1,#V1=16,#V2=1

I'm stumped on the logic part of  getting the TX into a string.

Any ideas or suggestions are greatly appreciated.



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]
======================================================================

Attachment: Get User Text.mcl
Description: Binary data

Reply via email to