Hot News:

Mit Unterstützung durch:

  Foren auf CAD.de (alle Foren)
  CATIA V5 Programmierung
  TXT to CATIA ( 3DPoint )

Antwort erstellen  Neues Thema erstellen
CAD.de Login | Logout | Profil | Profil bearbeiten | Registrieren | Voreinstellungen | Hilfe | Suchen

Anzeige:

Darstellung des Themas zum Ausdrucken. Bitte dann die Druckfunktion des Browsers verwenden. | Suche nach Beiträgen nächster neuer Beitrag | nächster älterer Beitrag
Autor Thema:  TXT to CATIA ( 3DPoint ) (3754 mal gelesen)
fenua73
Mitglied


Sehen Sie sich das Profil von fenua73 an!   Senden Sie eine Private Message an fenua73  Schreiben Sie einen Gästebucheintrag für fenua73

Beiträge: 4
Registriert: 03.05.2006

erstellt am: 28. Sep. 2007 18:40    Editieren oder löschen Sie diesen Beitrag!  <-- editieren / zitieren -->   Antwort mit Zitat in Fett Antwort mit kursivem Zitat    Unities abgeben: 1 Unity (wenig hilfreich, aber dennoch)2 Unities3 Unities4 Unities5 Unities6 Unities7 Unities8 Unities9 Unities10 Unities

Hello all,

I find a macro for inserting 3D points in a geometrical set(CATPart) from a txt file.I see a macro for the inverse operation (CATIA to txt) but not txt to CATIA.
I think the beginnig as the same like this :
---------------------------------------------------------
Dim partDocument1 As Document
Set partDocument1 = CATIA.ActiveDocument

Dim part1 As Part
Set part1 = partDocument1.Part

Dim filename As String
filename = CATIA.FileSelectionBox("Select the Excel file of the points", "*.txt", CatFileSelectionModeOpen)

Dim TextStr As TextStream
Set TextStr = filename.OpenAsTextStream("ForReading")
-------------------------------------------------------------------
But the rest i don't know.

Can anybody help me.

Thank in advance.
Fenua73.

P.S : I am sorry mi english is bad but my german no exist.

Eine Antwort auf diesen Beitrag verfassen (mit Zitat/Zitat des Beitrags) IP

Jens Hansen
Mitglied
Senior Consult


Sehen Sie sich das Profil von Jens Hansen an!   Senden Sie eine Private Message an Jens Hansen  Schreiben Sie einen Gästebucheintrag für Jens Hansen

Beiträge: 1055
Registriert: 05.08.2000

Win7
CATIA V5 R19
VB.Net
C#

erstellt am: 28. Sep. 2007 22:38    Editieren oder löschen Sie diesen Beitrag!  <-- editieren / zitieren -->   Antwort mit Zitat in Fett Antwort mit kursivem Zitat    Unities abgeben: 1 Unity (wenig hilfreich, aber dennoch)2 Unities3 Unities4 Unities5 Unities6 Unities7 Unities8 Unities9 Unities10 Unities Nur für fenua73 10 Unities + Antwort hilfreich

Hello,
it is not so easy as it shows at the beginning. What kind of data are in the txt file?
Generelly, you have to create an geometrical set. Then you have to read each line of the file and look for coordinates in x,y and z. After that, you create a point about these coordinates you read from this line an put it in the geometrical set.

By the way... there is an Excel-Macro, wich generetes point and splines in CATIA from reading coordinates from a datasheet. In these datasheet you can import your txt file.

Look for "Point.zip" at http://catia.cad.de/v5/download/Point.zip
There is an german help here: http://catia.cad.de/v5/download/Anleitung_Point_Makro.txt

best regards

Jens Hansen

Eine Antwort auf diesen Beitrag verfassen (mit Zitat/Zitat des Beitrags) IP

fenua73
Mitglied


Sehen Sie sich das Profil von fenua73 an!   Senden Sie eine Private Message an fenua73  Schreiben Sie einen Gästebucheintrag für fenua73

Beiträge: 4
Registriert: 03.05.2006

erstellt am: 01. Okt. 2007 07:52    Editieren oder löschen Sie diesen Beitrag!  <-- editieren / zitieren -->   Antwort mit Zitat in Fett Antwort mit kursivem Zitat    Unities abgeben: 1 Unity (wenig hilfreich, aber dennoch)2 Unities3 Unities4 Unities5 Unities6 Unities7 Unities8 Unities9 Unities10 Unities


Points.txt

 
Hello,
Thank you for your quick answer!
I know this macro with excel it's great but the problem is i have some 300 3D Points in a txt file like the file atachment.
For creating a Geometrical Set isn't a problem but i don't know how to read the txt file and then put this coordinate in a 3D Point.
-------------------------------
Sub CATMain()

Dim part1 As Part
Set part1 = partDocument1.Part

Dim hybridBodies1 As HybridBodies
Set hybridBodies1 = part1.HybridBodies

'Asks for Name of the Geometrical Set

GSname = inputBox ("Name of the Geometrical Set of the points")

'Create the Geometrical Set of the points

Dim hybridBody1 As HybridBody
Set hybridBody1 = hybridBodies1.Add()
hybridBody1.Name = GSname

Dim hybridShapeFactory1 As HybridShapeFactory
Set hybridShapeFactory1 = part1.HybridShapeFactory

Dim filename As String
filename = CATIA.FileSelectionBox("Select the Excel file of the points", "*.txt", CatFileSelectionModeOpen)

-------
It is the rest i don't know.
Can you help me please.
Thank in advance.
Fenua73.

Eine Antwort auf diesen Beitrag verfassen (mit Zitat/Zitat des Beitrags) IP

mkna
Mitglied
Konstrukteur


Sehen Sie sich das Profil von mkna an!   Senden Sie eine Private Message an mkna  Schreiben Sie einen Gästebucheintrag für mkna

Beiträge: 137
Registriert: 18.03.2005

erstellt am: 01. Okt. 2007 08:35    Editieren oder löschen Sie diesen Beitrag!  <-- editieren / zitieren -->   Antwort mit Zitat in Fett Antwort mit kursivem Zitat    Unities abgeben: 1 Unity (wenig hilfreich, aber dennoch)2 Unities3 Unities4 Unities5 Unities6 Unities7 Unities8 Unities9 Unities10 Unities Nur für fenua73 10 Unities + Antwort hilfreich


PunktNachCatia.zip

 
Hello

I found a long time ago here in the forum an excel file with a macro wich creates Point with the Point coordinates stored in the workbook. So first of all you should import the datas from the txt file into the excel file. Maybe you find a command in the pull-down menü "data" wich is called "Import data" in excel. I've got the german version of excel , due to this I don't know the english commands in the english version. Afterwards you can create the points.

Hope that helps

Martin

Eine Antwort auf diesen Beitrag verfassen (mit Zitat/Zitat des Beitrags) IP

fenua73
Mitglied


Sehen Sie sich das Profil von fenua73 an!   Senden Sie eine Private Message an fenua73  Schreiben Sie einen Gästebucheintrag für fenua73

Beiträge: 4
Registriert: 03.05.2006

erstellt am: 01. Okt. 2007 13:37    Editieren oder löschen Sie diesen Beitrag!  <-- editieren / zitieren -->   Antwort mit Zitat in Fett Antwort mit kursivem Zitat    Unities abgeben: 1 Unity (wenig hilfreich, aber dennoch)2 Unities3 Unities4 Unities5 Unities6 Unities7 Unities8 Unities9 Unities10 Unities

Yes i know this excel file but i am finding a direct solution between CATIA and txt file.
isn't it possible???

Thanks.
Fenua73

Eine Antwort auf diesen Beitrag verfassen (mit Zitat/Zitat des Beitrags) IP

Anzeige.:

Anzeige: (Infos zum Werbeplatz >>)

Darstellung des Themas zum Ausdrucken. Bitte dann die Druckfunktion des Browsers verwenden. | Suche nach Beiträgen

nächster neuerer Beitrag | nächster älterer Beitrag
Antwort erstellen


Diesen Beitrag mit Lesezeichen versehen ... | Nach anderen Beiträgen suchen | CAD.de-Newsletter

Administrative Optionen: Beitrag schliessen | Archivieren/Bewegen | Beitrag melden!

Fragen und Anregungen: Kritik-Forum | Neues aus der Community: Community-Forum

(c)2023 CAD.de | Impressum | Datenschutz