×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

I need some help with macro programming.

I need some help with macro programming.

I need some help with macro programming.

(OP)
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 :) ?

RE: I need some help with macro programming.

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

RE: I need some help with macro programming.

(OP)
Thank you very much! You are my hero :)

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources