Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Partfile Checking Using GRIP

Status
Not open for further replies.

Pondering

Aerospace
May 25, 2006
23
I have been given a task to automate as much as possible the task of part file checking drawings (non masters) as ‘Checkmate’ (NX2) does not contain sufficient checks for us.

Most stuff is straight forward layers etc......

But. I am creating a check to check of drafting entities outside the boundary of the drawing. Again this is simple enough. I verify the drawing to find its size, the query the drafting objects in the data base to find their origin. If it’s out side the boundary size, it's a fail!!!!

But what would be slicker if NX would tell me which sheet the offending entity is on. If you manually 'information > object' a drafting entity, it states 'resides on SHT001 etc'

My question is:-

Does anyone know a technique / command in GRIP to extract this bit of info?

Cheers in advance,

Pondering.....
 
Replies continue below

Recommended for you

This might seem a dumb question, how do I select all on the active sheet with GRIP.

Cheers,

Pondering
 
In GRIP unless you're doing an interactive selection, which I assume that you're not, you have to perform a database cycle. To start a 'cycle' you have to initialize your session with an INEXTE command. If you include a /ALL it will find all objects. If you don't include the /ALL it will only find objects are currently displayed.

After the INEXTE command you have to set a MASK such as MASK/25,26 which means that it will only look for Drafting Objects and Dimensions (note that Drafting Objects includes all non-Dimension objects that you might encounter on a drawing such as symbols, notes, GD&T, crosshatching, etc.)

Now you have to create some sort of loop or iterative JUMP scheme as you cycle the database using the NEXTE/ command (you use the IFEND option to exit your 'loop'). So as you cycle you assign each object a name and now you have a list of objects for that particular sheet.

And to set a current drawing to the active drawing, you use the &CURDRW statement.

I hope that helps.


John R. Baker, P.E.
Product 'Evangelist'
NX Product Line
UGS Corp
Cypress, CA
 
Pondering...

I've been down this road before, and acquired a few additional gray hairs in the process. There's a thingy I'd like to add to what John offered up that I'm sure you'll run into...

When cycling the db for drawing sheets, DON'T assume that the sheet 1 was the first created, sheet 2 was the 2nd, sht 3 the 3rd, etc. The db keeps track of the drawing sheets irrespective of what we call them (via the dwg sht creation date I thinks...).


Regards,
SS
CAD should pay for itself, shouldn't it?
 
Ok, this is the quick & dirty programme I wrote to test the theory.

The problem is when the dawing is activated, the system automatically does a 'FIT' this makes the entities which are outside the draiwng off the display. This means that they are not selected as the 'INEXTE/' will only cycle through the visble entities on the screen.

Question.

Can GRIP make the drawing zoom out to a small scale eg 0.001?. I can do this with a macro, but cant get GRIP to execute the macro.

Any Ideas?


ENTITY/OBJ
NUMBER/POS(3),SIZE(2),CNT
STRING/DWG(30)
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$

$$INITIALISE CYCLING THROUGH DRAWING SHEETS
INEXTN/62,IFERR,ERR003:

L10:

$$ RESET ENTITY COUNT TO ZERO
CNT=0

$$ GRAB CURRENT DRAWING SHEET PARAMETERS
DWG=NEXTN/IFEND,L20:,IFERR,ERR003:
&curdrw=dwg
DRAWV/,,,,SIZE,IFERR,ERR001:
PRINT/'DRAWING NAME = '+DWG
PRINT/'DRAWING WIDTH = '+FSTR(SIZE(2))
PRINT/'DRAWING HEIGHT = '+FSTR(SIZE(1))


$$ UNBLANK ALL ENTITIES IN PART
UNBLNK/ALL

$$ SET ALL LAYERS TO BE VISIBLE ON THE DRAWING SHEET
VIEWLC/DWG+'@0',VSBL,1..256,IFERR,ERR002:

$$ SET LAYERE 242 TO BE WORK LAYER, ALL LAYERS TO BE SELECTABLE
LAYER/WORK,242,ACTIVE,1..256

$$INITALISE CYCLING THROUGH ENTITTES ON DRAWING SHEET
INEXTE/
LOOP:
MASK/25,26,42,202
OBJ=NEXTE/IFEND,C1:
POS=&ORIGIN(OBJ)

IFTHEN/POS(1) < 0 OR POS(1) > SIZE(2)
CNT=CNT+1

ELSEIF/POS(2) < 0 OR POS(2) > SIZE(1)
CNT=CNT+1

ENDIF

JUMP/LOOP:

C1:
PRINT/'SHEET '+DWG +' CONTAINS ' +ISTR(CNT) +' ENTITES OUTSIDE THE FORMAT'

JUMP/L10:
L20:

DONE:
PRINT/'FINISHED PROCESSING'
PRINT/'ACTION PERFORMED BY:- '+&USERID
HALT

ERR001:
PRINT/'ERROR VERIFYING DRAWING'
JUMP/DONE:

ERR002:
PRINT/'ERROR SETTING LAYERS FOR DRAWING SHEET'
JUMP/DONE:

ERR003:
PRINT/'ERROR ACCESSING DRAWINGS'
JUMP/DONE:
 
Pondering,

Have your tried 'VIEWE'??? Not sure its applicable, but the docs look promising...

Additionally, I have some .grs files that may be of interest and/or use to you. One is a note extractor that extracts all notes/labels from all dwg sheets, maps their origins, and tells saves the notes to a text file for spell checking. It also identifies all lines of text starting with the letter(s) 'X'/'x'. This will pick up notes/labels outside the drawing view bounds, provided you can actually see the note on the screen when you 'fit' the dwg. Interested?

Regards,
SS
CAD should pay for itself, shouldn't it?
 
For hose of you who may be interested, I've cracked it.

The extra line of code is:-

viewe/DWG+'@0',scale,0.001

cheers,

P......
 
Cheers John,

Where theres a will, theres a way!!!!

P....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor