Hi brothers , I wrote a macro to get the XYZ coordinates of each nodes on selected entites ( face).but it does not work ! can somone help me !thanks
THIS IS THE MACRO :
sub main
Set swModel = swApp.ActiveDoc
Set swModExt = swModel.Extension
Set swSelMgr = swModel.SelectionManager
vBodies = Part.GetBodies2(0, False)
Set Body = vBodies(0)
Set Face = Body.GetFirstFace
Do While Not Face Is Nothing
CurFaceName = Part.GetEntityName(Face)
If (CurFaceName = "LV") Then
Face.Select (0) ' Select the face
Set swSelObj = swSelMgr.GetSelectedObject5(1)
vPIDarr = swModExt.GetPersistReference3(swSelObj)
sIDstring = GetStringFromID(swApp, swModel, vPIDarr)
Set pDisp1 = GetObjectFromString(swApp, swModel, sIDstring)
varArray1 = Array(pDisp1)
Set entity(0) = pDisp1
Set CWMesh = Study.Mesh
value = CWMesh.GetNodeDataFromEntity(pDisp1, NOD)
End If
Set Face = Face.GetNextFace
Loop
end sub
SolidworksApi macros