hi All
I use the routing API to autoroute a cable,but it route the cable is wrong, you can see the picture.
It's strange that the cable contain the route parts is tube.but it is right that route it by Manual operation.it is wrong by API. (you can see the code)
Dim RouteMgr As SWRoutingLib.RouteManager
Set RouteMgr = part.GetRouteManager()
Dim autoRoute As SWRoutingLib.autoRoute
boolstatus = part.Extension.SelectByID2(coordxyz(1) & "@" & coordxyz(0) & "-1@" & assyname, "CONNECTIONPOINT", 5.31492546461838E-03, 1.19969026634376E-02, -2.97071023443099E-02, False, 0, Nothing, 0)
RouteMgr.StartRoute "", ""
boolstatus = part.Extension.SelectByID2(coordxyz(2) & "@" & coordxyz(3) & "-1@" & assyname, "CONNECTIONPOINT", 7.86537370552647E-02, -6.48872632298151E-02, -3.56545684546688E-02, False, 0, Nothing, 0)
RouteMgr.AddToRoute
RouteMgr.EditRoute
part.ClearSelection2 True
Set autoRoute = RouteMgr.GetAutoRoute
'boolstatus = Part.Extension.SelectByID2("Point8", "SKETCHPOINT", -0.0007, 0.00033, 0.037, True, 0, Nothing, 0)
'boolstatus = Part.Extension.SelectByID2("Point3", "SKETCHPOINT", -0.00042, -0.02273, 0.03287, True, 0, Nothing, 0)
resultCode = autoRoute.CreatePointToPointAutoRoute(1)
SolidworksApi macros