create a bending table for a pipe
create a bending table for a pipe
(OP)
hi
Is it possible to create a bending table for a pipe which is modeled using Part module.This pipe is modelled using point coordinates. These points are used to produce a polyline with bending radius at some points.The polyline will be used as centre curve and a circle as a profile in rib command.This circle will be swept along with that profile.
Now i want to produce a bending-table which gives us the information regarding twist angle,bending radius etc. using this pipe automatically. Is it possible in catiav5.
thank you
Is it possible to create a bending table for a pipe which is modeled using Part module.This pipe is modelled using point coordinates. These points are used to produce a polyline with bending radius at some points.The polyline will be used as centre curve and a circle as a profile in rib command.This circle will be swept along with that profile.
Now i want to produce a bending-table which gives us the information regarding twist angle,bending radius etc. using this pipe automatically. Is it possible in catiav5.
thank you





RE: create a bending table for a pipe
Make a script. you can get XYZ point and from that do all you need.
Have fun
indocti discant et ament meminisse periti
RE: create a bending table for a pipe
But i have already created the pipe with points.only i need to generate a bending table for these pipes.
i am little new in using script. can you brief for any small example using a pipe. This would be a great help for me as i have many work to complete which is only based on this.
Just i need to know how can i know the twist angle for the generĂ¡ted pipe.
RE: create a bending table for a pipe
As for the twist angle then I return the question... whow do you define the twist angle? Your answer should help you build some code.
CODE
' Writer : Eric Neuville for CATIA forums
'
'
' This scipt scan Geometrical Sets in a Part
' Then get XYZ of points (values in mm)
' and create a report as a Text file located in the CATReport folder
'
'
' version 1.0
'
' work with Geometrical Set only
' do not works with OGS, HybridBodies, or Geometrical set in Bodies
' work with Points only
' do not work with Sketches, intersection, projection, transformations...
Sub CATMain()
Dim oPartDoc As Part
Dim oHBs As HybridBodies
Dim oHSs As HybridShapes
Dim TheSPAWorkbench As Workbench
Dim oRef As Point
Dim referenceObject As Reference
Dim TheMeasurable As Variant
Dim aCoordinates(2) As Variant
Dim aToExport(5000, 2) As Variant
Dim iNumberOfPoint As Integer
Dim MinDistance As Double
On Error Resume Next
Set oPartDoc = CATIA.ActiveDocument.Part ' get the active doc as a Part
Set oHBs = oPartDoc.HybridBodies ' define the geometrical set collection
If Err.Number <> 0 Then ' if not a part or no geometrical set then end
Message = MsgBox("Sorry, This script works with a CATPart as Active document", vbCritical, "Error")
Exit Sub
End If
Set TheSPAWorkbench = CATIA.ActiveDocument.GetWorkbench("SPAWorkbench") ' get the SPA workbench in order to get coordinates
Set oHSs = oHBs.GetItem("Points").HybridShapes ' get the HybridShape collection
For i = 1 To oHSs.Count ' go thru all HybridShape in geometrical set
Set oRef = oHSs.Item(i)
Set referenceObject = oPartDoc.CreateReferenceFromGeometry(oRef) ' set reference in order to use Measurable
Set TheMeasurable = TheSPAWorkbench.GetMeasurable(referenceObject) ' set Measurable with reference
TheMeasurable.GetPoint (aCoordinates) ' get coordinates from Measurable
If Err.Number = 0 Then ' if reference is point then
iNumberOfPoint = iNumberOfPoint + 1 ' count the number of point
aToExport(iNumberOfPoint, 3) = oRef.Name ' get the name of point in array
For U = 0 To 2
aToExport(iNumberOfPoint, U) = aCoordinates(U) ' get coordinates in array
Next U
End If
Err.Clear ' reset error to 0
Next i ' next hybridshape
WriteTxTFile iNumberOfPoint, aToExport ' sent array to file using sub()
End Sub
Sub WriteTxTFile(iNumber As Integer, XYZ_array() As Variant)
Dim sPath As String
Dim sTime As String
Dim sName As String
Dim sFile As String
otime = Replace(Time, ":", "-")
oName = "d:\" & Left(CATIA.ActiveDocument.Name, Len(CATIA.ActiveDocument.Name) - 8) & "-" & otime & ".txt"
Open oName For Output As #1 ' open file for writting
Write #1, "Points Extraction from CATIA" ' write in file
Write #1,
Write #1, "Name : Z : X : Y"
Write #1,
For A = 1 To iNumber
Write #1, XYZ_array(A, 2), ":", XYZ_array(A, 1), ":", XYZ_array(A, 0), ":", XYZ_array(A, 1) ' write in file name and coordinate from array
Next A
Close
MsgBox "Check the file : " & oName, vbInformation ' information about job done
End Sub
indocti discant et ament meminisse periti
RE: create a bending table for a pipe
Thanks
indocti discant et ament meminisse periti