Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I need some help with macro programming. 1

Status
Not open for further replies.

LukaK

Mechanical
Jan 15, 2007
25
0
0
SI
Hello i have some problems with macro programming

I have this .prg file which changes some colors in drafting.
This .prg worked in I-DEAS Master Series 8 but it doesn't work in I-DEAS 12 NX.

c:*****************************************************************
c:* *
c:* Program za korekcijo barve crt *
c:* *
c:*****************************************************************
c:
c: Program pretvarja barve crt po opravljenem prenosu iz modelerja
c:

# geomcolor = 1 ;rdeca
# hidecolor = 9 ;Lt blue
# notecolor = 3 ;rumena
# dimcolor = 3 ;rumena
c:


c:
# inquire ent max (entmax)
# inquire view number (currentview)
c:
# for i = 38 to entmax do
# Inquire Entity Characteristics ( i, , , , layer, , , , , )
# if (layer eq 204) then goto spremenicrto1
# if (layer eq 205) then goto spremenicrto2
# if (layer eq 206) then goto spremenicrto2
# if (layer eq 200) then goto skrijdim1

c:
# setfinished:
# next
#
# delete all ;delete all of the variables from
e: end ;the database and end
c:

# spremenicrto1:
# Modify Entity Characteristics ( i, , , , geomcolor, )
# goto setfinished

# spremenicrto2:
# Modify Entity Characteristics ( i, , , , hidecolor, )
# goto setfinished

# skrijdim1:
# Modify Entity Characteristics ( i,1, , , , )
# goto setfinished


When i apply this .prg in I-DEAS 12 NX i get this error:

Error, line 31: cannot execute 'NEXT', no matching 'FOR'

The like 31 is:

# next


Any tip maybe how to fix this :) ?
 
Replies continue below

Recommended for you

I am able to duplicate this, didn't have too much time to diagnose the cause, but was able to come up with a quick workaround to make the macro run. I took out the "goto" from the IF-THEN statement and have it directly run the procedure call. Below is the modified version of the macro that works:

# geomcolor = 1 ;rdeca
# hidecolor = 9 ;Lt blue
# notecolor = 3 ;rumena
# dimcolor = 3 ;rumena
c:
# inquire ent max (entmax)
# inquire view number (currentview)
c:
# for i = 38 to entmax do
# Inquire Entity Characteristics ( i, , , , layer, , , , , )
# if (layer eq 204) then Modify Entity Characteristics ( i, , , , geomcolor, )
# if (layer eq 205) then Modify Entity Characteristics ( i, , , , hidecolor, )
# if (layer eq 206) then Modify Entity Characteristics ( i, , , , hidecolor, )
# if (layer eq 200) then Modify Entity Characteristics ( i,1, , , , )
c:
# next
#
# delete all ;delete all of the variables from
e: end ;the database and end
c:


Hope this helps,
Mike
 
Status
Not open for further replies.
Back
Top