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!

Grip code that reads in a CSV text file of points? 2

Status
Not open for further replies.

Zrob

Structural
Aug 4, 2007
47
Hey all, I am a VB.net guy and I was just told that GRIP is all we have to work with! I need to read in x, y, z points line by line from a text file, then create a line through each set of points. Do you guys have any grip code examples on how to do this? All points are on a 2D plane so z always = 0


AutoCAD and UGS NX 5 & 7 User
South Coast Mass
 
Replies continue below

Recommended for you

Attached is a simple GRIP program which will read a text file containing point data in an X,Y,Z formatted comma-delimited text file and create the points. This should help to get you headed in the right direction.

John R. Baker, P.E.
Product 'Evangelist'
Product Design Solutions
Siemens PLM Software Inc.
Industry Sector
Cypress, CA

To an Engineer, the glass is twice as big as it needs to be.
 
I can't wait to work with this on Monday!

Thanks John!


AutoCAD and UGS NX 5 & 7 User
South Coast Mass
 
According to your signature you are running NX5 and 7, you should have journaling available to you. Journaling can be done in the .NET languages (VB included), or has a decision been made specifically to NOT use journaling for some reason?
 
Yes thanks for that suggestion, is that ran like VB script or something, I mean how does it get compiled? I usually compile .net in the visual studios. Would you have a sample that would read in a csv text file.



AutoCAD and UGS NX 5 & 7 User
South Coast Mass
 
It is a lot like VBScript, it gets compiled at runtime.

Set your preference to Visual Basic (Preferences -> User Interface) and record a quick journal. The output is a .vb file that you can open and edit with any text editor. You'll see VB code just as you would enter it into the IDE and you can make changes and run the journal to see what happens. I'd suggest going to the GTAC site, there are some good examples there.
 
Thanks, that makes sense, I did look at that and also recorded a macro. I think I would rather do the GRIP instead though but I will try and keep an open mind. If I had my way I would buy the .net license.

Thanks!

AutoCAD and UGS NX 5 & 7 User
South Coast Mass
 
You do not need to buy a .NET license for basic journaling tasks (such as reading in a file of points).
 
Do you have an example of one?


AutoCAD and UGS NX 5 & 7 User
South Coast Mass
 
That example looks really nice; I like that open dialog and it looks a lot like .net! Thanks this will really get me going.

AutoCAD and UGS NX 5 & 7 User
South Coast Mass
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor