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!

Line Normal to a surface

Status
Not open for further replies.

Aar0nr

New member
Aug 20, 2013
9
MX
i need to construct a line normal to a vector, so i can calculate a unitary vector to a certain face.

i am using the command addnewlinenormal but i have to do it for a whole set of faces.

Set objsel = CATIA.ActiveDocument.Selection
objsel.Clear
objsel.Search "Type=Topology.Face,all"
X = objsel.Count2

Set partDocument1 = CATIA.ActiveDocument
Set part1 = partDocument1.Part
Set Selection = partDocument1.Selection

Set ref1 = Selection.Item(i).Reference 'First reference

Dim punto As HybridShapeFactory
Set punto = part1.HybridShapeFactory

Dim coord As HybridShapePointCoord
Set coord = punto.AddNewPointCoord(xc, yc, zc)

Dim hybridBodies1 As HybridBodies
Set hybridBodies1 = part1.HybridBodies

Dim hybridBody1 As HybridBody
Set hybridBody1 = hybridBodies1.Item("Geometrical Set.1")

hybridBody1.AppendHybridShape coord

Dim bodies1 As Bodies
Set bodies1 = part1.Bodies

Dim bodies1 As Bodies
Set bodies1 = part1.Bodies

Dim body1 As Body
Set body1 = bodies1.Item("PartBody")

Dim shapes1 As Shapes
Set shapes1 = body1.Shapes

Dim solid1 As Solid
Set solid1 = shapes1.Item("PartBody")

Dim reference2 As Reference
Set reference2 = coord 'Second reference

Dim hybridShapeLineNormal1 As HybridShapeLineNormal
Set hybridShapeLineNormal1 = hybridShapeFactory1.AddNewLineNormal(ref1, reference2, 0#, 20#, False)

hybridBody1.AppendHybridShape hybridShapeLineNormal1

part1.InWorkObject = hybridShapeLineNormal1

all references should be complete eventhough its not working. THANKS in advance

 
Replies continue below

Recommended for you

by the way, the error that i came up with is '424 Object requiered'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Top