Preview | SOLIDWORKS USER FORUM
Use your SOLIDWORKS ID or 3DEXPERIENCE ID to log in.
BBBill Bigbee-Hansen16/11/2019
I am trying to create a macro which creates xyz curves from a set of text files. I have code that will update existing data but want to automate the model set up. I have used macros to create a series of named planes but am stumbling on how to create the curve feature. Following code was used to update curves.
'*******************************************************************************************************
' read in section curves
For i = 1 To 10
swModel.ClearSelection2 True
section = sections(i) & "cv"
bRet = swModel.Extension.SelectByID2(section, "REFERENCECURVES", 0, 0, 0, False, 0, Nothing, 0)
Set swFeat = swSelMgr.GetSelectedObject6(1, -1)
Set swFeatData = swFeat.GetDefinition
Path_and_file_name = Current_Dir & "\Section_" & sections(i) & ".SLDCRV"
bRet = swFeatData.LoadPointsFromFile(Path_and_file_name)
swFeat.ModifyDefinition swFeatData, swModel, Nothing
For i = 1 To 10
swModel.ClearSelection2 True
section = sections(i) & "cv"
bRet = swModel.Extension.SelectByID2(section, "REFERENCECURVES", 0, 0, 0, False, 0, Nothing, 0)
Set swFeat = swSelMgr.GetSelectedObject6(1, -1)
Set swFeatData = swFeat.GetDefinition
Path_and_file_name = Current_Dir & "\Section_" & sections(i) & ".SLDCRV"
bRet = swFeatData.LoadPointsFromFile(Path_and_file_name)
swFeat.ModifyDefinition swFeatData, swModel, Nothing
Next i
'*******************************************************************************************************
Any suggestions would be appreciated