几何尺寸与公差论坛

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

【转帖】need help to create extrude boss with thread contour

[复制链接]
发表于 2009-4-12 21:52:10 | 显示全部楼层 |阅读模式
need help to create extrude boss with thread contour
hi everyone...
i need help to create extrude boss with thread contour on its face automatically...
now, when i create thread feature, i use 2 step respectively, first create extrude boss then select the face in sw then second, create thread texture... now i need help how to integrated it with one click...
i use this code to make extrude boss (i use .net 05):
private sub btdraw_click(byval sender as system.object, byval e as system.eventargs) handles btdraw.click
dim swapp as object
dim part as object
dim diameter as double
dim tinggi as double
'definisi diameter dan tinggi
diameter = cdbl(txtdiameter.text) / 1000
tinggi = cdbl(txttinggi.text) / 1000
'koneksi ke solidworks
swapp = new sldworks.sldworks()
part = swapp.activedoc
'membuat part di solidworks
part.sketchmanager.insertsketch(true)
part.createcirclebyradius2(0, 0, 0, diameter / 2)
part.featuremanager.featureextrusion2(true, false, false, 0, _
0, tinggi, 0, false, false, false, false, 0.01745, _
0.01745, false, false, false, false, 1, 1, 1, 0, 0, false)
end sub
and to make thread texture i use this code :
private sub btulir_click(byval sender as system.object, byval e as system.eventargs) handles btulir.click
dim swapp as sldworks.sldworks
dim part as sldworks.modeldoc2
dim selmgr as sldworks.selectionmgr
dim swface as sldworks.face2
dim face as sldworks.face2
dim texture as sldworks.texture
dim boolstatus as boolean
dim configname as string
dim ball as boolean
dim configvar as object
dim namstr as string
dim swmodeldocext as sldworks.modeldocextension
'koneksi ke solidworks
swapp = new sldworks.sldworks()
part = swapp.activedoc
selmgr = part.selectionmanager()
swface = selmgr.getselectedobject5(1)
swmodeldocext = part.extension
configname = "default"
ball = true
face = selmgr.getselectedobject5(1)
dim configarr(0 to 0) as string
configarr(0) = configname
configvar = configarr
texture = face.gettexture(configname)
texture = face.gettexture(configname)
namstr = "\images\textures\thread\thread.png"
texture = swmodeldocext.createtexture(namstr, 5, 45, false)
boolstatus = face.settexture(configname, texture)
end sub
both code is running but i wonder how to integrated it with just one click / one step...
thanx alot...
hi,
the featureextrusion2 returns a feature object.
getfaces from it.
getsurface from each face.
check if the surface iscylinder.
apply texture to that face.
quick
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

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

Powered by Discuz! X3.4 Licensed

© 2001-2023 Discuz! Team.

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