几何尺寸与公差论坛

 找回密码
 注册
查看: 1428|回复: 0

【转帖】creating a reference poin on a surface

[复制链接]
发表于 2009-4-12 20:36:07 | 显示全部楼层 |阅读模式
creating a reference poin on a surface
below is a program in which i'm trying to create a reference point on a surface, the surface is also generated by the program. however selection for this operation seems to be very tricky, can any one help?
dim swapp as object
dim part as object
dim selmgr as object
dim boolstatus as boolean
dim longstatus as long, longwarnings as long
dim feature as object
sub main()
set swapp = application.sldworks
set part = swapp.activedoc
set selmgr = part.selectionmanager
swapp.activedoc.activeview.frameleft = 0
swapp.activedoc.activeview.frametop = 0
swapp.activedoc.activeview.framestate = 1
part.insertcurvefilebegin
part.insertcurvefilepoint -0.01891591270404, 0.04538478608051, -0.0075998
part.insertcurvefilepoint -0.01295227029848, 0.05068547478921, -0.00426348
part.insertcurvefilepoint -0.006572013100673, 0.05526205530891, -0.00111903
part.insertcurvefilepoint 2.199154259509e-04, 0.05916088126177, 0.00183415
part.insertcurvefilepoint 0.00732360743588, 0.06239590250343, 0.00459669
part.insertcurvefilepoint 0.01461327156056, 0.06499968590379, 0.00716965
part.insertcurvefilepoint 0.02197518728987, 0.06703035732224, 0.00955556
part.insertcurvefilepoint 0.02930479526756, 0.06856632695042, 0.0117572
part.insertcurvefilepoint 0.03653918318391, 0.06968680194267, 0.01377736
part.insertcurvefilepoint 0.04367993552615, 0.07044040407822, 0.01561885
part.insertcurvefilepoint 0.05076445216998, 0.07083843717138, 0.01728827
part.insertcurvefilepoint 0.05782977740253, 0.07087062897435, 0.01880531
part.insertcurvefilepoint 0.06490338534568, 0.07051284078728, 0.02019244
part.insertcurvefilepoint 0.07200454567976, 0.06972864466163, 0.02147213
part.insertcurvefilepoint 0.0791500470213, 0.06846745624759, 0.02266395
part.insertcurvefilepoint 0.08635571444439, 0.06666537443453, 0.02377957
part.insertcurvefilepoint 0.09362630522925, 0.06424793346281, 0.02482935
part.insertcurvefilepoint 0.1009404302709, 0.06115150706714, 0.02582365
part.insertcurvefilepoint 0.1082237262587, 0.05738569537993, 0.02677446
part.insertcurvefilepoint 0.115338898068, 0.05311336127662, 0.02769728
part.insertcurvefilepoint 0.1221244174371, 0.04867374057143, 0.02860807
part.insertcurvefilepoint 0.1284791063044, 0.04445182721635, 0.02952266
part.insertcurvefilepoint 0.1344141377258, 0.04067772283349, 0.03044558
part.insertcurvefilepoint 0.1400187239672, 0.03736670444673, 0.03136144
part.insertcurvefilepoint 0.1453975540512, 0.03439065419686, 0.03225282
part.insertcurvefilepoint 0.1506392171733, 0.03155986504545, 0.03310308
part.insertcurvefilepoint 0.1558008276688, 0.02866087936061, 0.03393217
part.insertcurvefilepoint 0.1609190023958, 0.02537920732766, 0.03481238
part.insertcurvefilepoint 0.1660123398466, 0.02127486589031, 0.03582
part.insertcurvefileend
part.insertcurvefilebegin
part.insertcurvefilepoint -0.01927548600098, 0.04730598261394, -0.00957431
part.insertcurvefilepoint -0.01312756600679, 0.05249194565057, -0.0062247
part.insertcurvefilepoint -0.006559419031845, 0.05695169348352, -0.00305997
part.insertcurvefilepoint 4.121238392238e-04, 0.06072315148807, -0.00008073
part.insertcurvefilepoint 0.007677578322257, 0.06382087686131, 0.00271242
part.insertcurvefilepoint 0.01510711059776, 0.06628170931832, 0.00531921
part.insertcurvefilepoint 0.02258517397523, 0.06816769383001, 0.0077404
part.insertcurvefilepoint 0.0300082123606, 0.06956086236472, 0.00997697
part.insertcurvefilepoint 0.03731524642198, 0.07054364337889, 0.01202987
part.insertcurvefilepoint 0.04450839158969, 0.07116819211493, 0.01390008
part.insertcurvefilepoint 0.05162686524883, 0.07144809392657, 0.01559308
part.insertcurvefilepoint 0.05871069284771, 0.07137278703057, 0.01712953
part.insertcurvefilepoint 0.06578985679384, 0.07091692228311, 0.01853325
part.insertcurvefilepoint 0.0728860786529, 0.07004192720535, 0.0198281
part.insertcurvefilepoint 0.08001787435151, 0.06869519215201, 0.0210346
part.insertcurvefilepoint 0.08720209682442, 0.06681262096287, 0.02216451
part.insertcurvefilepoint 0.09444317762584, 0.06432141017114, 0.02322812
part.insertcurvefilepoint 0.1017177421349, 0.06116324751568, 0.02423572
part.insertcurvefilepoint 0.1089495200817, 0.05735611017151, 0.02519921
part.insertcurvefilepoint 0.1160019623243, 0.05307067386556, 0.02613391
part.insertcurvefilepoint 0.1227211184172, 0.04864030647325, 0.02705556
part.insertcurvefilepoint 0.1290179214312, 0.04442295260276, 0.02797982
part.insertcurvefilepoint 0.1349097290922, 0.04062070688175, 0.0289113
part.insertcurvefilepoint 0.140482860382, 0.03724068820131, 0.02983524
part.insertcurvefilepoint 0.1458353803257, 0.03416450803562, 0.03073491
part.insertcurvefilepoint 0.1510501367763, 0.03121683595097, 0.03159431
part.insertcurvefilepoint 0.1561808763592, 0.02819582424986, 0.03243259
part.insertcurvefilepoint 0.1612606559145, 0.02480574482249, 0.03331923
part.insertcurvefilepoint 0.1663047276174, 0.02063128337015, 0.0343275
part.insertcurvefileend
part.insertcurvefilebegin
part.insertcurvefilepoint -0.01937947045832, 0.04932513237897, -0.01154882
part.insertcurvefilepoint -0.0130849055073, 0.05434998246856, -0.00818591
part.insertcurvefilepoint -0.006371211107647, 0.05865992731951, -0.0050009
part.insertcurvefilepoint 7.388798328124e-04, 0.06228343742075, -0.00199561
part.insertcurvefilepoint 0.008130981999245, 0.06523301921055, 0.00082815
part.insertcurvefilepoint 0.01567292031969, 0.06754650019944, 0.00346877
part.insertcurvefilepoint 0.0232474130282, 0.06928680070272, 0.00592525
part.insertcurvefilepoint 0.03075088257807, 0.0705373843277, 0.00819675
part.insertcurvefilepoint 0.03812193502972, 0.0713829811311, 0.01028239
part.insertcurvefilepoint 0.04536114248728, 0.07187924297917, 0.01218132
part.insertcurvefilepoint 0.05250855430721, 0.07204205135181, 0.0138979
part.insertcurvefilepoint 0.05960718405441, 0.07186017993316, 0.01545374
part.insertcurvefilepoint 0.06668964605339, 0.07130657338527, 0.01687407
part.insertcurvefilepoint 0.07377961055409, 0.07034050238141, 0.01818406
part.insertcurvefilepoint 0.08089666147263, 0.06890784195949, 0.01940525
part.insertcurvefilepoint 0.08805799934761, 0.06694498253524, 0.02054945
part.insertcurvefilepoint 0.09526734953988, 0.06438159780563, 0.02162689
part.insertcurvefilepoint 0.1024994968611, 0.06116503635561, 0.0226478
part.insertcurvefilepoint 0.1096770729086, 0.05732081110378, 0.02362397
part.insertcurvefilepoint 0.1166660373802, 0.05302383825289, 0.02457053
part.insertcurvefilepoint 0.1233209245961, 0.04859769248551, 0.02550306
part.insertcurvefilepoint 0.1295628425583, 0.04437532518546, 0.02643697
part.insertcurvefilepoint 0.135412661785, 0.04053817683938, 0.02737702
part.insertcurvefilepoint 0.1409531230554, 0.03708991059098, 0.02830904
part.insertcurvefilepoint 0.1462764386471, 0.03392140173259, 0.029217
part.insertcurvefilepoint 0.1514609011262, 0.03086881672897, 0.03008553
part.insertcurvefilepoint 0.1565577036777, 0.02773899050478, 0.03093303
part.insertcurvefilepoint 0.1615974016953, 0.02424938428827, 0.03182608
part.insertcurvefilepoint 0.1665930413882, 0.01999910323757, 0.032835
part.insertcurvefileend
part.clearselection2 true
part.insertloftrefsurface2 false, true, false, 1, 0, 0
part.clearselection2 true
part.blankrefgeom
'i would like to select created surface and create a poin in the middle of the surface or where its
'requried
'however the selection seems to be very tricy to do the same!
'boolstatus = part.extension.selectbyid2("pressure_surface", "refsurface", 0, 0, 0, false, 0, nothing, 0)
'dim vrefpointfeatures as variant
'vrefpointfeatures = part.featuremanager.insertreferencepoint(4, 0, 0.01, 1)
end sub
thanks,
abbas
quick
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|小黑屋|几何尺寸与公差论坛

GMT+8, 2024-12-23 08:53 , Processed in 0.037663 second(s), 19 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表