![]() |
【转帖】need help to create extrude boss with thread contour
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 |
所有的时间均为北京时间。 现在的时间是 11:50 AM. |