Using Grip To Edit Text In NX Drafting
Using Grip To Edit Text In NX Drafting
(OP)
Due to UG not having True Type Font in Drafting, I currently bring AutoCAD artwork files into UG. The text will appear like this in the UG Annotation Editor: <F1>1000-1234<F>. We assign a new font (helios_bold_con) to the text. In order for the system to recognize the new font, you must edit the text and remove the <F1> & <F>.
Can anyone help me write a grip program to strip this from each piece of text on a drawing? There may be 20-100 occurrences on a drawing that needs editing.
Can anyone help me write a grip program to strip this from each piece of text on a drawing? There may be 20-100 occurrences on a drawing that needs editing.
Larry Leonard
Senior Designer
Smith-Nephew Orthopaedics





RE: Using Grip To Edit Text In NX Drafting
Try to mask/25 for text entities, pick it with an ident statement, delete the existing string, edit the string, then create a new note with the revised string in the old location.
"Wildfires are dangerous, hard to control, and economically catastrophic."
Ben Loosli
Sr IS Technologist
L-3 Communications
RE: Using Grip To Edit Text In NX Drafting
Could we come up with a program that would let me pick a text string then delete the first 4 characters and the last 4 characters of that text string then let me pick another without terminating, and maybe Cancel or Esc if I want to terminate the program.
Larry Leonard
Senior Designer
Smith-Nephew Orthopaedics
RE: Using Grip To Edit Text In NX Drafting
Yes...it's possible, just depends on what you want. You could write a routine that will cycle through all dwg sheets and notes removing the offending chars without user input, or you could have the user pick each note individually. Each has advantages and disadvantages... If your likely to have text strings with these chars that you will want to keep, then I'd go with having the user select them. Otherwise, I'd have it go globally and take the chance of a user error (missing one) out of the equation. You could even set it up to cycle through the notes automatically and give the user a choice on whether or not to edit it or go to the next one...
Regards,
SS
CAD should pay for itself, shouldn't it?
RE: Using Grip To Edit Text In NX Drafting
Larry Leonard
Senior Designer
Smith-Nephew Orthopaedics
RE: Using Grip To Edit Text In NX Drafting
CODE
NUMBER/ORIG(3),LNS,RSP
STRING/NTXT(132),RTXT(132)
L1:
MASK/25 $$DRAFTING OBJECTS
IDENT/'INDICATE NOTE',L,RSP
JUMP/L1:,L1:,,RSP
$$ SAVE ORIGIN OF NOTE,
$$ SINCE WE WILL HAVE TO DELETE THE OLD NOTE
$$ AND PLACE A NEW ONE
ORIG(1..3)=&ORIGIN(L)
$$ RETRIEVE TEXT OF OBJECT
NTXT=&DMTEXT(L)
$$ REPLACE TEXT IN NOTE
RTXT=REPSTR(NTXT,'<F1>','',1)
RTXT=REPSTR(RTXT,'<F>','',1)
$$ CREATE NEW NOTE
NOTE/ORIG(1),ORIG(2),RTXT
$$ DELETE OLD NOTE
DELETE/L
HALT
Bear in mind that this is only to get you started, it does not do any error checking and could use improvements. For instance, it only runs once (easily fixed with a loop), it only checks for <F1> and <F> (if there is <F2> or <F3>,etc it will miss them), and it does not check for multi line notes.
All of the above shortcomings are fixable and you will probably want to change it so that it runs with no user intervention to minimize missed notes.
RE: Using Grip To Edit Text In NX Drafting
Larry Leonard
Senior Designer
Smith-Nephew Orthopaedics
RE: Using Grip To Edit Text In NX Drafting
Yes this is a very good start however I do need the LOOP, MULTIPLE LINE CHECK and NO USER INTERVENTION if at all possible. This text is placed in one the model for a visual check against the associated AutoCAD file. Since you must be in Drafting to EDIT text, there will be only one drawing per part.
Larry Leonard
Senior Designer
Smith-Nephew Orthopaedics
RE: Using Grip To Edit Text In NX Drafting
thanks
Larry Leonard
Senior Designer
Smith-Nephew Orthopaedics
RE: Using Grip To Edit Text In NX Drafting
PLM Exchange
http://plmexchange.net
http://groups-beta.google.com/group/NX_CAX/
RE: Using Grip To Edit Text In NX Drafting
Larry Leonard
Senior Designer
Smith-Nephew Orthopaedics
RE: Using Grip To Edit Text In NX Drafting
CODE
$$
$$ KEYWORDS:
$$
$$ ABSTRACT: A search and replace program that globally replaces
$$ existing note text with new keyed-in text.
$$
$$ RELEASE HISTORY:
$$ 19-NOV-86 INITIAL RELEASE, DEWAYNE EVANS
$$ 15-JUN-87 REVISION 0, DEWAYNE EVANS
$$ 01-AUG-87 SUBMITTED TO LIBRARY
$$
$$ Required Subroutines: (None)
$$
$$ AUTHOR: DEWAYNE EVANS
$$ TITLE:
$$ COMPANY: McDonnell Douglas M & E
$$ Santa Clara, CA
$$ 408-727-6990
$$
$$ SYSTEM TYPE:
$$
NUMBER/CCF,CCS,CEC,CES,CTA,CTD,CTJ,CWL,DAD(23),DFV,DLV,EL(3),EP,FS
NUMBER/NEP,NSP,QE,RSP,SDLV,SL,SP,SSDLV,TS
ENTITY/CWCS,ENT(1000),N
STRING/ITXT(132),NT(132),NTXT(132),OT(132)
DATA/SP,1,EP,0,DFV,2
$$
$$
$$ ENTITY VARIABLES:
$$ ENT = ENTITY, N = NOTE
$$
$$ STRING VARIABLES:
$$ OT = OLD TEXT, NT = NEW TEXT
$$ ITXT = INITIALIZE TEXT, NTXT = NOTE TEXT
$$
$$ NUMBER VARIABLES:
$$ QE = QUANTITY OF ENTITIES, SP = START POSITION, EP = END POSITION
$$ LNT = LENGTH OF NEW TEXT, SL = STRING LENGTH, FS = FIND STRING
$$ NEP = NEW END POSITION, DAD = DRAFTING AID DATA
$$ EL = ENTITY LOCATION, DLV = DO-LOOP VARIABLE, DFV = DEFAULT VALUE
$$ SDLV = SUB-DO-LOOP VARIABLE, SSDLV = SECOND SUB-DO-LOOP VARIABLE
$$ NSP = NEW START POSITION, TS = TERMINATION SWITCH
$$
$$
CWL=&WLAYER $$ CURRENT WORK LAYER
CCF=&CFONT $$ CURRENT CHAR FONT
CCS=&CSIZE $$ CURRENT CHAR SIZE
CWCS=&WCS $$ CURRENT WCS
CEC=&ENTCLR $$ CURRENT ENTITY COLOR
CTJ=&TXJUST $$ CURRENT TEXT JUSTIFICATION
CES=&ENSITE $$ CURRENT ENTITY SITE
CTD=&TDENS $$ CURRENT TEXT DENSITY
CTA=&TXANGL $$ CURRENT TEXT ANGLE
$$
$$
IA05:
CHOOSE/'READ HELP FILE',$
'YES', $
'NO', $
DEFLT,DFV,RSP
JUMP/IA05:,TERM:,,,HELP10:,IA10:,RSP
$$
$$
IA10:
TS=1 $$ TERMINATION SWITCH ON
DFV=1
TEXT/'ENTER OLD TEXT',OT,RSP
JUMP/IA05:,TERM:,IA10:,,IA20:,RSP
$$
$$
IA20:
TS=2 $$ TERMINATION SWITCH OFF
TEXT/'ENTER NEW TEXT',NT,RSP
JUMP/IA10:,TERM:,IA20:,,IA30:,RSP
$$
$$
IA30:
PARAM/'SEARCH POSITIONS',$
'START',INT,SP, $
'END',INT,EP,RSP
JUMP/IA20:,TERM:,,RSP
IF/SP-1,EM10:,,
JUMP/IA40:
$$
$$
EM10:
MESSG/'START VALUE','MUST BE > 0'
JUMP/IA30:
$$
$$
IA40:
MASK/25
&WCS=CSYS/&WVIEW
IDENT/'SELECT TEXT',ENT,CNT,QE,RSP
JUMP/IA30:,TERM:,DL10:,RSP
$$
$$
DL10: $$ SEARCH AND REPLACE TEXT STRINGS
MESSG/TEMP,'SEARCHING'
DO/DLL10:,DLV,1,QE
IF/&SUBTYP(ENT(DLV))-1,,,DLL10:
ITXT=&DMTEXT(ENT(DLV))
SL=LENF(ITXT)
IF/SP-SL,,DLL10:,DLL10:
FS=FNDSTR(ITXT,OT,SP)
IF/FS+0,,DLL10:,
NTXT=REPSTR(ITXT,OT,NT,FS)
IF/SP-EP,DL30:,ID10:,DL20:
$$
$$
DL20: $$ SEARCH ENTIRE TEXT STRING
DO/DLL20:,SDLV,1,132
NSP=FS+LENF(NT)
FS=FNDSTR(NTXT,OT,SP)
IF/FS+0,,ID10:,
NTXT=REPSTR(NTXT,OT,NT,FS)
DLL20:
$$
$$
DL30: $$ SEARCH UP TO END POSITION
DO/DLL30:,SSDLV,1,132
NSP=FS+LENF(NT)
NEP=LENF(NTXT)-LENF(ITXT)+EP
FS=FNDSTR(NTXT,OT,NSP)
IF/FS+0,,ID10:,
IF/NSP-NEP,,ID10:,ID10:
NTXT=REPSTR(NTXT,OT,NT,FS)
DLL30:
$$
$$
ID10: $$ REPLACE TEXT STRINGS
&WLAYER=&LAYER(ENT(DLV))
&ENTCLR=&COLOR(ENT(DLV))
OBTAIN/ENT(DLV),DAD
&CSIZE=DAD(1)
&CFONT=DAD(3)
&TXJUST=DAD(2)
&ENSITE=DAD(19)
&TDENS=DAD(4)
&TXANGL=DAD(5)
EL=&ORIGIN(ENT(DLV))
DELETE/ENT(DLV)
N=NOTE/EL(1),EL(2),NTXT
DLL10:
JUMP/IA10:
$$
$$
HELP10:
PRINT/'THIS PROGRAM REPLACES EXISTING NOTE TEXT WITH NEW'
PRINT/'KEYED IN TEXT.'
PRINT/''
PRINT/'FIRST, KEY IN THE OLD TEXT (THE TEXT TO BE REPLACED).'
PRINT/''
PRINT/'SECOND, KEY IN THE NEW TEXT (REPLACEMENT TEXT).'
PRINT/''
PRINT/'THIRD, INDICATE THE START POSITION. THE START'
PRINT/'POSITION TELLS THE PROGRAM AT WHAT CHARACTER WITHIN'
PRINT/'THE NOTE TO BEGIN LOOKING FOR THE OLD TEXT. (A START'
PRINT/'POSITION OF 1 WOULD INDICATE THE BEGINING OF A NOTE).'
PRINT/''
PRINT/'FOURTH, INDICATE THE END POSITION. THE END POSITION'
PRINT/'TELLS THE PROGRAM AT WHAT CHARACTER WITHIN THE NOTE'
PRINT/'TO STOP SEARCHING FOR THE OLD TEXT. AN END POSITION'
PRINT/'OF 0 TELLS THE PROGRAM TO SEARCH THE ENTIRE NOTE.'
PRINT/''
PRINT/'NOTE: THIS PROGRAM EDITS NOTE ENTITIES ONLY. THE NEW TEXT'
PRINT/'IS CREATED IN THE CURRENT WORK VIEW. ALSO, IT DOES NOT'
PRINT/'ACCOMODATE NOTES WITH MULTIPLE LINES OF TEXT.'
JUMP/IA10:
$$
$$
TERM:
IF/TS-1,,,IA10:
&WLAYER=CWL
&WCS=CWCS
&ENTCLR=CEC
&CFONT=CCF
&CSIZE=CCS
&TXJUST=CTJ
&ENSITE=CES
&TDENS=CTD
&TXANGL=CTA
HALT
RE: Using Grip To Edit Text In NX Drafting
PS: The above program works fine but does not do what I want and requires user intervention which we can not have (user error factor).
Here are the factors to consider:
1-Removing <F1> and <F>
2-Remove any brackets containing <K??> and <K>. (example: <K46> )
3-Text string may be multiple lines of text so consider when writing the code.
(example: <F1><U>ABC
DEFG HIJK
1234-5678<F><U>
(Note: This text is underlined which I want to keep so only remove <F1> and <F>.)
4-Origin of text should remain the same as original text.
5-Set text font to helios_bold_con.
6-Cycle through whole drawing without user intervention.
This would be an extra if not to much trouble:
7-Remove all occurrences of digits 2122 from text strings when they follow text characters (example: ABC2122).
(This is a diamond character in AutoCAD but comes in as numbers in UG).
This is all I can think of at this time.
thanks,
Larry Leonard
Senior Designer
Smith-Nephew Orthopaedics
RE: Using Grip To Edit Text In NX Drafting
This actually assign color to the text and this is OK.
One thing I did forget on the list was to keep existing properties like color, character size and origin.
I'm learning as I go here about what is going on from AutoCAD into UG so other things may change.
thanks,
Larry Leonard
Senior Designer
Smith-Nephew Orthopaedics
RE: Using Grip To Edit Text In NX Drafting
Need the new text to be same size, color and origin as old text and be helios_bold_con.
Larry Leonard
Senior Designer
Smith-Nephew Orthopaedics
RE: Using Grip To Edit Text In NX Drafting
Larry
RE: Using Grip To Edit Text In NX Drafting
If you want someone to take the time and effort to write a code for you, then just ask around and I'm sure some arrangeements can be made. If nobody around here is interested, just hit the web and there's a number of companies out there that will be happy to help you out.
Hope this helps....
Regards,
SS
CAD should pay for itself, shouldn't it?
RE: Using Grip To Edit Text In NX Drafting
http://gr
-Dave
PLM Exchange
http://plmexchange.net
http://groups.google.com/group/NX_CAX/
RE: Using Grip To Edit Text In NX Drafting
$*********************************************************
ENTITY/L, ents(1000)
NUMBER/ORIG(3),LNS,RSP, cntr, spot
STRING/NTXT(132),RTXT(132)
data/ cntr, 0
inexte/ all
MASK/25 $$DRAFTING OBJECTS
L1:
spot = -1
L = nexte/ ifend, Z99:
if/ L == &nulent, jump/ z99:
ORIG(1..3)=&ORIGIN(L)
$$ RETRIEVE TEXT OF OBJECT
$$ COPY SETTINGS $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
E_CLR=&ENTCLR
W_LAY=&WLAYER
C_SIZ=&CSIZE
C_FNT=&CFONT
E_SIT=&ENSITE
T_JUS=&TXJUST
NTXT=&DMTEXT(L)
spot = FNDSTR(NTXT,'<F1>',1)
ifthen/ spot >= 1
cntr = cntr + 1
ents(cntr) = L
$$REPLACE TEXT IN NOTE
RTXT=REPSTR(NTXT,'<F1>','',1)
RTXT=REPSTR(RTXT,'<F>','',1)
$$CREATE NEW NOTE
NOTE/ORIG(1),ORIG(2),RTXT
$$ DELETE OLD NOTE
$$ DELETE/L $$ we can't delete while cycling
endif
jump/ L1:
Z99:
$$ done cycling, so now delete all the old notes
ifthen/ cntr > 0
delete/ ents(1..cntr)
endif
print/ 'CNTR: ', cntr
HALT
$***************************************************
lsl49
RE: Using Grip To Edit Text In NX Drafting
What is happening is the new note is being written at the default settings, not the original settings.
Add a section at the top of your code to capture the default settings.
E_CLR_0=&ENTCLR
W_LAY_0=&WLAYER
C_SIZ_0=&CSIZE
C_FNT_0=&CFONT
E_SIT_0=&ENSITE
T_JUS_0=&TXJUST
Change the section you have where you are saving the settings to save them from the string instead of global settings.
E_CLR=&ENTCLR(L)
W_LAY=&WLAYER(L)
C_SIZ=&CSIZE(L)
C_FNT=&CFONT(L)
E_SIT=&ENSITE(L)
T_JUS=&TXJUST(L)
Now set your system to these values.
&ENTCLR=e_clr
&WLAYER=w_lay
&CSIZE=c_siz
&CFONT=c_fnt
&ENSITE=e_sit
&TXJUST=t_jus
Write your note.
Then reset the values to the system defaults.
&ENTCLR=e_clr_0
&WLAYER=w_lay_0
&CSIZE=c_siz_0
&CFONT=c_fnt_0
&ENSITE=e_sit_0
&TXJUST=t_jus_0
This will reset the system back to the way it was before you executed your program.
ALWAYS cleanup after yourself!
"Wildfires are dangerous, hard to control, and economically catastrophic."
Ben Loosli
Sr IS Technologist
L-3 Communications
RE: Using Grip To Edit Text In NX Drafting
It will not compile. I receive error 79 undefined GPA symbol for (L).
$********************************
ENTITY/L, ents(1000)
NUMBER/ORIG(3),LNS,RSP, cntr, spot
STRING/NTXT(132),RTXT(132)
data/ cntr, 0
inexte/ all
$$ CAPTURE CURRENT SYSTEM SETTINGS $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
E_CLR_0=&ENTCLR
W_LAY_0=&WLAYER
C_SIZ_0=&CSIZE
C_FNT_0=&CFONT
E_SIT_0=&ENSITE
T_JUS_0=&TXJUST
MASK/25 $$DRAFTING OBJECTS
L1:
spot = -1
L = nexte/ ifend, Z99:
if/ L == &nulent, jump/ z99:
ORIG(1..3)=&ORIGIN(L)
$$ COPY CURRENT TEXT STRING SETTINGS $$$$$$$$$$$$$$$$$$$
E_CLR=&ENTCLR(L)
W_LAY=&WLAYER(L)
C_SIZ=&CSIZE(L)
C_FNT=&CFONT(L)
E_SIT=&ENSITE(L)
T_JUS=&TXJUST(L)
$$ RETRIEVE TEXT OF OBJECT
NTXT=&DMTEXT(L)
spot = FNDSTR(NTXT,'<F1>',1)
ifthen/ spot >= 1
cntr = cntr + 1
ents(cntr) = L
$$ REPLACE TEXT IN NOTE
RTXT=REPSTR(NTXT,'<F1>','',1)
RTXT=REPSTR(RTXT,'<F>','',1)
$$ CREATE NEW NOTE
$$ SET SYSTEM TO THESE VALUES $$$$$$$$$$$$$$$$$$$$$$$$$$$$
&ENTCLR=e_clr
&WLAYER=wlay
&CSIZE=c_size
&CFONT=c_fnt
&ENSITE=e_sit
&TXJUST=t_jus
$$ SET CFONT TO HELIOS_BOLD_CON $$$$$$$$$$$$$$$$$$$$$$$$$$
SET
C_FNT=&CFONT(4)
NOTE/ORIG(1),ORIG(2),RTXT
$$ DELETE OLD NOTE
$$ DELETE/L $$ we can't delete while cycling
endif
jump/ L1:
Z99:
$$ done cycling, so now delete all the old notes
ifthen/ cntr > 0
delete/ ents(1..cntr)
endif
print/ 'CNTR: ', cntr
$$ RESET SYSTEM TO ORIGINAL SETTINGS $$$$$$$$$$$$$$$$$$$$$
&ENTCLR=e_clr_0
&WLAYER=wlay_0
&CSIZE=c_size_0
&CFONT=c_fnt_0
&ENSITE=e_sit_0
&TXJUST=t_jus_0
HALT
$********************************************************
thanks,
lsl49
RE: Using Grip To Edit Text In NX Drafting
lsl49
RE: Using Grip To Edit Text In NX Drafting
Sort out the GPA's and the EDA's and you are well on your way to a working program (it also doesn't like the SET command sitting by itself on line 61). To change the font, look up the ASGNFT command.
RE: Using Grip To Edit Text In NX Drafting
I use an _GPA_SAVE.GRS ...
Proc/ Gpavlu
Number/ Gpavlu(43)
Gpavlu(1) = &Apsite
Gpavlu(2) = &Aunit
Gpavlu(3) = &Cfont
Gpavlu(4) = &Cnmode
Gpavlu(5) = &Csize
return
and an _GPA_REST.GRS ...
Proc/ Gpavlu
Number/ Gpavlu(43)
&Apsite = Gpavlu(1)
&Aunit = Gpavlu(2)
&Cfont = Gpavlu(3)
&Cnmode = Gpavlu(4)
&Csize = Gpavlu(5)
return
Paul Phillips
Specialty Engineered Automation
http://www.sea4ug.com
RE: Using Grip To Edit Text In NX Drafting
It reported an error "subscript a non-array variable" on the line 19 (calling out the helios_bold_con font) and program failed compilation.
I received 2 linking errors when I tried to link.
In _GPA_SAVE called from test_program. Wrong number of argumnets _GPA_SAVE
In _GPA_REST called from test_program. Wrong number of
arguments _GPA_REST
----------------------------------------------
Here are the sub-routines:
$****************_GPA_SAVE.GRS****************
Proc/ Gpavlu
Number/ Gpavlu(43)
Gpavlu(1) = &Apsite
Gpavlu(2) = &Aunit
Gpavlu(3) = &Cfont
Gpavlu(4) = &Cnmode
Gpavlu(5) = &Csize
return
-------------------------------------------------
$***********_GPA_REST.GRS****************
Proc/ Gpavlu
Number/ Gpavlu(43)
&Apsite = Gpavlu(1)
&Aunit = Gpavlu(2)
&Cfont = Gpavlu(3)
&Cnmode = Gpavlu(4)
&Csize = Gpavlu(5)
return
------------------------------------------------------
Here is the current program:
$********************************
ENTITY/L, ents(1000)
NUMBER/ORIG(3),LNS,RSP, cntr, spot
STRING/NTXT(132),RTXT(132)
data/ cntr, 0
inexte/ all
MASK/25 $$DRAFTING OBJECTS
$$ Call Subroutine
CALL/'_GPA_SAVE'
$$ SET CFONT TO HELIOS_BOLD_CON $$$$$$$$$$$$$$$$$$$$$$$$$$
ASGNFT/Gpavlu(3),4,IFERR,L1:
L1:
spot = -1
L = nexte/ ifend, Z99:
if/ L == &nulent, jump/ z99:
ORIG(1..3)=&ORIGIN(L)
$$ RETRIEVE TEXT OF OBJECT
NTXT=&DMTEXT(L)
spot = FNDSTR(NTXT,'<F1>',1)
ifthen/ spot >= 1
cntr = cntr + 1
ents(cntr) = L
$$ REPLACE TEXT IN NOTE
RTXT=REPSTR(NTXT,'<F1>','',1)
RTXT=REPSTR(RTXT,'<F>','',1)
$$ CREATE NEW NOTE
NOTE/ORIG(1),ORIG(2),RTXT
$$ DELETE OLD NOTE
$$ DELETE/L $$ we can't delete while cycling
endif
jump/ L1:
Z99:
$$ done cycling, so now delete all the old notes
ifthen/ cntr > 0
delete/ ents(1..cntr)
endif
$$ Call Subroutine
CALL/'_GPA_REST'
print/ 'CNTR: ', cntr
HALT
----------------------------------------------------------
I'm not sure if this is the way I want to go but I thought it might be good experience.
thanks,
lsl49
RE: Using Grip To Edit Text In NX Drafting
Number/ Gpavlu(43)
in your case, you can change the 43 to 5, including the sub-routines. My version controls 43 GPA's.
Paul Phillips
Specialty Engineered Automation
http://www.sea4ug.com
RE: Using Grip To Edit Text In NX Drafting
CODE
CODE
The '4' in the above command means that any note using font number 4 will now be changed to helios bold con, is that your intention? If you just want to be sure that helios bold con is available, use the following:
CODE
FNUM=&FNTNUM('helios_bold_con')
RE: Using Grip To Edit Text In NX Drafting
Paul, I am still getting "Wrong Number of Arguments" on the sub-routines.
$****************_GPA_SAVE.GRS****************
Proc/ Gpavlu
Number/ Gpavlu(5)
Gpavlu(1) = &Apsite
Gpavlu(2) = &Aunit
Gpavlu(3) = &Cfont
Gpavlu(4) = &Cnmode
Gpavlu(5) = &Csize
return
-------------------------------------------------
$***********_GPA_REST.GRS****************
Proc/ Gpavlu
Number/ Gpavlu(5)
&Apsite = Gpavlu(1)
&Aunit = Gpavlu(2)
&Cfont = Gpavlu(3)
&Cnmode = Gpavlu(4)
&Csize = Gpavlu(5)
return
$*********** MAIN PROGRAM *************
ENTITY/L, ents(1000)
NUMBER/ ORIG(3), LNS, RSP, cntr, spot
STRING/ NTXT(132), RTXT(132)
data/ cntr, 0
inexte/ all
MASK/25 $$DRAFTING OBJECTS
$$ Call Subroutine
CALL/'_GPA_SAVE'
$$ ****** SET CFONT TO HELIOS_BOLD_CON *******
ASGNFT/'helios_bold_con',4,IFERR,L1:
L1:
spot = -1
L = nexte/ ifend, Z99:
if/ L == &nulent, jump/ z99:
ORIG(1..3)=&ORIGIN(L)
$$ RETRIEVE TEXT OF OBJECT
NTXT=&DMTEXT(L)
spot = FNDSTR(NTXT,'<F1>',1)
ifthen/ spot >= 1
cntr = cntr + 1
ents(cntr) = L
$$ REPLACE TEXT IN NOTE
RTXT=REPSTR(NTXT,'<F1>','',1)
RTXT=REPSTR(RTXT,'<F>','',1)
$$ CREATE NEW NOTE
NOTE/ORIG(1),ORIG(2),RTXT
$$ DELETE OLD NOTE
$$ DELETE/L $$ we can't delete while cycling
endif
jump/ L1:
Z99:
$$ done cycling, so now delete all the old notes
ifthen/ cntr > 0
delete/ ents(1..cntr)
endif
$$ Call Subroutine
CALL/'_GPA_REST'
print/ 'CNTR: ', cntr
HALT
What am I'm doing wrong?
lsl49
RE: Using Grip To Edit Text In NX Drafting
NUMBER/ ORIG(3), LNS, RSP, cntr, spot, Gpavlu(5)
Then for your two "Call/" statements, they need to be written as ...
CALL/'_GPA_SAVE', Gpavlu
CALL/'_GPA_REST', Gpavlu
Are the sub-routines compiling ?
Paul Phillips
Specialty Engineered Automation
http://www.sea4ug.com
RE: Using Grip To Edit Text In NX Drafting
thanks,
lsl49
RE: Using Grip To Edit Text In NX Drafting
I just have to keep plugging away at it.
thanks
lsl49
RE: Using Grip To Edit Text In NX Drafting
I am having a hard time editing multiple lines of text.
Any suggestions?
lsl49
RE: Using Grip To Edit Text In NX Drafting
CODE
STRING/NTXT(132,132)
NUMBER/LNS,J
LNS=0
NTXT=&DMTEXT(L)
DO/NMLNS:,J,1,132
IFTHEN/LENF(NTXT(J))>0
LNS=LNS+1
ENDIF
NMLNS: