Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB How-To
|
VB How-To Ask your "How do I do this with VB?" questions in this forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 7th, 2003, 11:48 AM
Registered User
 
Join Date: Jun 2003
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default reading different numbers from multiline text ?

I am about to insert a graphical image from an autocad drawing to my VB form. I don't want to calculate all the coordinates of the 3D sphere and cube that I need in my VB form so I impored the Autocad STL file containing the coordinates. Now problem is, I am able to copy entire file in my multiline textbox but not able to read the different coordinates from my textbox into arrays.

Help me !
Sagar
 
Old August 7th, 2003, 11:59 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 128
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Is there a delimeter in the text file?

Can you provide a copy of the STL file so that we can see the format.

VB has some nice tools for parsing a text file into an array but the one I am thinking of requires some kind of delimeter.


Larry Asher
 
Old August 9th, 2003, 12:40 AM
Registered User
 
Join Date: Jun 2003
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The first few line os the STL file looks like this when you open it up with wordpad:

solid AutoCAD
   facet normal 2.4543471e-001 -2.0337300e-002 -9.6919977e-001
      outer loop
         vertex 3.3246995e+000 5.9458172e+000 6.0272774e+000
         vertex 3.3291892e+000 6.0000000e+000 6.0272774e+000
         vertex 3.6493989e+000 6.0000000e+000 6.1083655e+000
      endloop
   endfacet
   facet normal 2.4543471e-001 -2.0337300e-002 -9.6919977e-001
      outer loop
         vertex 3.3246995e+000 5.9458172e+000 6.0272774e+000
         vertex 3.6493989e+000 6.0000000e+000 6.1083655e+000
         vertex 3.6405420e+000 5.8931124e+000 6.1083655e+000
      endloop
   endfacet

This is only a demo, there are thousands of line like this. I just want to get inside a line and then read a number which is in format 2.4543471e-001 separated from others by a space or a "."

I also want the first number to be put in X-array, second number in Y-array and third number in Z-array. Then go to next line of the multiline textbox and get other numbers likewise.

I have also sent you a mail with attached STL file, in case you want to see what the whole stuff looks like.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Displaying multiline text in a datagrid (WinForm) markb1719 VB.NET 2 November 24th, 2008 09:52 PM
max length property of multiline text box MunishBhatia ASP.NET 2.0 Professional 5 June 14th, 2007 01:55 AM
passing multiline text to the report snansala Crystal Reports 0 October 17th, 2006 08:51 AM
VS.NET - Using a multiline text box VSnewbie Classic ASP Databases 3 September 10th, 2004 09:50 AM
Multiline Text in Rich TextBox Niaz Pro VB 6 3 March 1st, 2004 07:57 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.