Selection

Hi
Attached is a program which creates 3 curves using points. I would
like to create a loft surface using these surface. I=92m not able to
select these curves in the program, I=92ve tried using SelectedbyId
functions etc, which didn=92t help much. Can anyone please help me
select these curves using API?
Thanks,
Abbas
using System;
using System.Collections.Generic;
using System.Text;
using SolidWorks.Interop.sldworks;
using SolidWorks.Interop.swconst;
using SolidWorks.Interop.swpublished;
using SolidWorksTools;
namespace swexternal
{
class Program
{
static void Main(string[] args)
{
int errors=3D0;
SldWorks apps;
apps =3D new SldWorks();
apps.Visible =3D true;
ModelDoc2 docss =3D (ModelDoc2) apps.NewDocument("D:\\Apps\
\SolidWorks\\data\\templates\\Part.prtdot",0,0,0);
docss =3D (ModelDoc2) apps.IActivateDoc2(docss.GetTitle(),
true, ref errors);
SelectionMgr selmgr =3D (SelectionMgr)
docss.SelectionManager;
docss.ClearSelection();
docss.InsertCurveFileBegin();
docss.InsertCurveFilePoint(-14.7423941, 66.6919240,
-27.344880);
docss.InsertCurveFilePoint(-8.1518985, 69.7831106,
-23.875650);
docss.InsertCurveFilePoint(-1.1017990, 72.4103280,
-20.528390);
docss.InsertCurveFilePoint(6.3608413, 74.5229707,
-17.314650);
docss.InsertCurveFilePoint(14.1092576, 76.0951217,
-14.245990);
docss.InsertCurveFilePoint(22.0118828, 77.1371390,
-11.334770);
docss.InsertCurveFilePoint(29.9400582, 77.6817446,
-8.5959600);
docss.InsertCurveFilePoint(37.7729529, 77.7946323,
-6.0450400);
docss.InsertCurveFilePoint(45.4214878, 77.5616051,
-3.6974900);
docss.InsertCurveFilePoint(52.8572528, 77.0546989,
-1.5687800);
docss.InsertCurveFilePoint(60.1127856, 76.3007026,
0.3364100);
docss.InsertCurveFilePoint(67.2416348, 75.2797743,
2.0474900);
docss.InsertCurveFilePoint(74.2879007, 73.9494796,
3.6005900);
docss.InsertCurveFilePoint(81.2772187, 72.2579348,
5.0318000);
docss.InsertCurveFilePoint(88.2250404, 70.1500642,
6.3704800);
docss.InsertCurveFilePoint(95.1456991, 67.5756318,
7.6289900);
docss.InsertCurveFilePoint(102.0376378, 64.4894300,
8.8170500);
docss.InsertCurveFilePoint(108.8713524, 60.8748435,
9.9444000);
docss.InsertCurveFilePoint(115.5799736, 56.7849264,
11.0220100);
docss.InsertCurveFilePoint(122.0695385, 52.3686994,
12.0635400);
docss.InsertCurveFilePoint(128.2548022, 47.8447839,
13.0829800);
docss.InsertCurveFilePoint(134.0967624, 43.4185378,
14.0942200);
docss.InsertCurveFilePoint(139.6124815, 39.2101453,
15.1027700);
docss.InsertCurveFilePoint(144.8553373, 35.2412771,
16.0994800);
docss.InsertCurveFilePoint(149.8878044, 31.4558766,
17.0737200);
docss.InsertCurveFilePoint(154.7669127, 27.7429945,
18.0153500);
docss.InsertCurveFilePoint(159.5321488, 23.9521790,
18.9364600);
docss.InsertCurveFilePoint(164.2042751, 19.8636002,
19.8809100);
docss.InsertCurveFilePoint(168.7976277, 15.0341292,
20.8950000);
docss.InsertCurveFileEnd();
docss.InsertCurveFileBegin();
docss.InsertCurveFilePoint(-18.0144813, 57.9115648,
-19.4468500);
docss.InsertCurveFilePoint(-11.4103275, 62.0397041,
-16.0307800);
docss.InsertCurveFilePoint(-4.3903418, 65.5649821,
-12.7646500);
docss.InsertCurveFilePoint(3.0146974, 68.4745488,
-9.6551300);
docss.InsertCurveFilePoint(10.6865044, 70.7625757,
-6.7089200);
docss.InsertCurveFilePoint(18.4933872, 72.4557977,
-3.9330000);
docss.InsertCurveFilePoint(26.3132443, 73.6053197,
-1.3353500);
docss.InsertCurveFilePoint(34.0363241, 74.2885576,
1.0758500);
docss.InsertCurveFilePoint(41.5896485, 74.5929176,
3.2924500);
docss.InsertCurveFilePoint(48.9603115, 74.5844683,
5.3062700);
docss.InsertCurveFilePoint(56.1863758, 74.2860120,
7.1171600);
docss.InsertCurveFilePoint(63.3186931, 73.6823920,
8.7506200);
docss.InsertCurveFilePoint(70.3978358, 72.7386316,
10.2373300);
docss.InsertCurveFilePoint(77.4506350, 71.4072366,
11.6079300);
docss.InsertCurveFilePoint(84.4961915, 69.6320497,
12.8878700);
docss.InsertCurveFilePoint(91.5507590, 67.3550764,
14.0892200);
docss.InsertCurveFilePoint(98.6146784, 64.5186789,
15.2219700);
docss.InsertCurveFilePoint(105.6582814, 61.0911194,
16.2961000);
docss.InsertCurveFilePoint(112.6061529, 57.1186962,
17.3229900);
docss.InsertCurveFilePoint(119.3428321, 52.7711115,
18.3170300);
docss.InsertCurveFilePoint(125.7568977, 48.3177011,
19.2930100);
docss.InsertCurveFilePoint(131.7960643, 44.0136983,
20.2656000);
docss.InsertCurveFilePoint(137.4823057, 39.9970468,
21.2398900);
docss.InsertCurveFilePoint(142.8822778, 36.2782864,
22.2042600);
docss.InsertCurveFilePoint(148.0705833, 32.7795994,
23.1453600);
docss.InsertCurveFilePoint(153.1129408, 29.3689899,
24.0504400);
docss.InsertCurveFilePoint(158.0536195, 25.8784232,
24.9347400);
docss.InsertCurveFilePoint(162.9172450, 22.0602148,
25.8535000);
docss.InsertCurveFilePoint(167.7159605, 17.5097220,
26.8650000);
docss.InsertCurveFileEnd();
docss.InsertCurveFileBegin();
docss.InsertCurveFilePoint(-17.3354647, 60.1123158,
-21.421360);
docss.InsertCurveFilePoint(-10.7098045, 63.9844912,
-17.992000);
docss.InsertCurveFilePoint(-3.6630430, 67.2889002,
-14.705580);
docss.InsertCurveFilePoint(3.7716825, 70.0026061,
-11.570010);
docss.InsertCurveFilePoint(11.4752077, 72.1144515,
-8.5931900);
docss.InsertCurveFilePoint(19.3165573, 73.6469812,
-5.7834400);
docss.InsertCurveFilePoint(27.1723441, 74.6466976,
-3.1505100);
docss.InsertCurveFilePoint(34.9304634, 75.1881040,
-0.7043700);
docss.InsertCurveFilePoint(42.5140607, 75.3582937,
1.5449700);
docss.InsertCurveFilePoint(49.9062971, 75.2250793,
3.5875100);
docss.InsertCurveFilePoint(57.1439571, 74.8124463,
5.4219700);
docss.InsertCurveFilePoint(64.2789024, 74.1041073,
7.0748400);
docss.InsertCurveFilePoint(71.3528310, 73.0631772,
8.5781400);
docss.InsertCurveFilePoint(78.3925419, 71.6409445,
9.9639000);
docss.InsertCurveFilePoint(85.4163715, 69.7813471,
11.2585200);
docss.InsertCurveFilePoint(92.4400807, 67.4282831,
12.4741600);
docss.InsertCurveFilePoint(99.4633364, 64.5274070,
13.6207400);
docss.InsertCurveFilePoint(106.4561230, 61.0513332,
14.7081700);
docss.InsertCurveFilePoint(113.3448030, 57.0491352,
15.7477400);
docss.InsertCurveFilePoint(120.0194087, 52.6858916,
16.7536600);
docss.InsertCurveFilePoint(126.3758764, 48.2173064,
17.7405100);
docss.InsertCurveFilePoint(132.3660192, 43.8841471,
18.7227500);
docss.InsertCurveFilePoint(138.0107126, 39.8188965,
19.7056100);
docss.InsertCurveFilePoint(143.3729303, 36.0351174,
20.6780700);
docss.InsertCurveFilePoint(148.5239158, 32.4612674,
21.6274500);
docss.InsertCurveFilePoint(153.5269962, 28.9712528,
22.5416700);
docss.InsertCurveFilePoint(158.4251355, 25.4018768,
23.4351700);
docss.InsertCurveFilePoint(163.2419809, 21.5125062,
24.3603500);
docss.InsertCurveFilePoint(167.9900950, 16.8904577,
25.3725000);
docss.InsertCurveFileEnd();
docss.EntityProperties();
docss.ClearSelection();
docss.ViewZoomtofit();
//apps.ExitApp();
//apps =3D null;
}
}
}
Reply to
Abbas
Loading thread data ...

PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.