Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

NX POINT GRIP

Status
Not open for further replies.

stevethb

Specifier/Regulator
Nov 27, 2008
46
HI

Anyone who could help me with some source code for compiling a program?

The function should be like this:

The 3D-model part file contains some points.
These points is manually selected, one by one, from the modeling.
The grip program should output the X, Y and Z coordinates drawing table and the lenght betwen points.
Numbering of the points ( P1, P2.. ) shall be the same as the selecting order of the points. (or if grip could select points by it sef automaticly starting from wcs 0,0,0)

the table should look like this

pt x y z r

I don't know if i present problem corectly.
 
Replies continue below

Recommended for you

Hi AGAIN

I got that GRIP aplication :)

$$
$$ PROGRAM: Point_Coordinates.grs
$$
$$ RELEASE HISTORY :
$$ 25-Jan-10 : Initial submission to library.
$$
$$
$$
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$$
$$ Variable Definition
$$
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$

NUMBER/ X(3)
NUMBER/ Y(3)
NUMBER/ Z(3)
NUMBER/ U(3)
NUMBER/ V(3)
NUMBER/ W(3)
NUMBER/ ILEN(3)
NUMBER/ IDECPL

ENTITY/ ENTY
ENTITY/ KSYS
ENTITY/ ENT
ENTITY/ LABELA(500)

STRING/ WVIEW(30)
STRING/ STATION(4,20)
STRING/ NOTA(10,30)

$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$$
$$ Data Definition
$$
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$

DATA/STATION,'X #@@@.@@@@@@@@@@@@',$
'Y #@@@.@@@@@@@@@@@@',$
'Z #@@@.@@@@@@@@@@@@',$
'#@@@@@@@@@@@@@@@@@@@'


$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$$
$$ Active Part Check
$$
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$

IFTHEN/&ACTPRT==1
MESSG/'You don''t have an active part !'
HALT
ENDIF


$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$$
$$ Read/Setup System Variables
$$
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$

IWLAYER = &WLAYER
IFONT = &FONT
ILWIDTH = &LWIDTH
ITLWID = &TLWID
ITEXTOR = &TEXTOR
ITDENS = &TDENS
ITXJUST = &TXJUST
IVTXJST = &VTXJST
IENSITE = &ENSITE
ICFONT = &CFONT
ICSIZE = &CSIZE
IDSIZE = &IDSIZE

&WLAYER = 201
&FONT = &SOLID
&LWIDTH = &NORMAL
&TLWID = &NORMAL
&TEXTOR = &TXBANG
&TDENS = &NORMAL
&TXJUST = &LEFT
&VTXJST = &TOP
&ENSITE = &MIDC
&CFONT = 1
&CSIZE = .1250
&IDSIZE = .500
ILABELA = 0
IDECPL = 3

&FILARW = 1
&ARIANG=20.
&ASIZE=.2
&TLWID=&THIN
&TEXTOR=&TXBANG
&ENSITE=&MIDC
&TDENS=&THIN
&VTXJST=&TOP
IRED=0


$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$$
$$ Create Point Coordinate Label
$$
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$

LOOPA: &VWCURS = &ANY
&WCS = &ABS
&DECPL = IDECPL
MASK/2,3
IDENT/'Select Entity',ENT,CURSOR,X,MEMBER,OFF,RESP
JUMP/END:,END:,,RESP
&VWCURS=&ANY
WVIEW=&VWSEL
IFTHEN/ENT<>&NULENT
ITYPE=&TYPE(ENT)
X=MAP/X,FROM,WVIEW,TO,&CURDRW
IFTHEN/ITYPE==2
OBTAIN/ENT,Z
ELSE
OBTAIN/ENT,Z,U
ENDIF

&VWCURS=&WORK
POS/'Locate Label Origin',Y,RESP
JUMP/LOOPA:,LOOPA:,RESP

CREATE/TXT,8
DO/LOOPD:,N,1,3
NOTA(N)=SUBSTR(STATION(N),1,9+IDECPL)
WRITE/8,USING,NOTA(N),Z(N)
LOOPD:
RESET/8
READ/8,USING,STATION(4),NOTA(1)
READ/8,USING,STATION(4),NOTA(2)
READ/8,USING,STATION(4),NOTA(3)
FTERM/TXT,8

ILABELA=ILABELA+1
IFTHEN/Y(1)>X(1)
LABELA(ILABELA)=LABEL/LEFT,Y(1),Y(2),$
ENT,VIEW,WVIEW,NOTA(1..3)
ELSE
LABELA(ILABELA)=LABEL/RIGHT,Y(1),Y(2),$
ENT,VIEW,WVIEW,NOTA(1..3)
ENDIF

IRED=IRED+1
PRINT/'P'+ISTR(IRED)
PRINT/NOTA(1)
PRINT/NOTA(2)
PRINT/NOTA(3)
ENDIF
JUMP/LOOPA:


$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$$
$$ Reinstate System Variables
$$
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$

END: &WLAYER = IWLAYER
&FONT = IFONT
&LWIDTH = ILWIDTH
&TLWID = ITLWID
&TEXTOR = ITEXTOR
&TDENS = ITDENS
&TXJUST = ITXJUST
&VTXJST = IVTXJST
&ENSITE = IENSITE
&CFONT = ICFONT
&CSIZE = ICSIZE
&IDSIZE = IDSIZE

HALT


This Aplication read point position and export to file txt position X Y Z i need to export it to table in drafting. Please someone Help ME


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor