几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量  


返回   几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 » 仿射空间:CAX软件开发(三)二次开发与程序设计 » CAD二次开发 » SolidWorks二次开发
用户名
密码
注册 帮助 会员 日历 银行 搜索 今日新帖 标记论坛为已读


回复
 
主题工具 搜索本主题 显示模式
旧 2009-04-12, 09:38 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】macro for part elevations

macro for part elevations?
is it possible to gather coordinate information in a drawing by picking a surface in a view, return one value and insert it into text? we often create drawings for mock-up models that require only one view with elevation dimensions (see attached). currently, we transfer dimensions from one view to another which can introduce errors. multi-view drawings are not an option for this particular application.
i can create some basic macro programming but i haven't been able to make much headway with where to start on this. any help would be much appreciated- thanks in advance!
john summers, cswp
system:
sw 2009 sp2.0
dell precision 490
intel xeon 5160@3.00 ghz, dual core
nvidia fx-4600, 6.14.11.6265 driver, dual monitors
windows xp 32 w/ 4 gig memory, 3 gig switch
is it possible to gather coordinate information in a drawing by picking a surface in a view, return one value and insert it into text?
not quite sure i follow... what coordinates are you after? you select a surface so do you want all points on a surface boundary, or is there a sketch associated with that surface and instead you want to get some information from that sketch somewhere, or is it something else entirely?
hey luke, thanks for the reply!
what i am looking for is i would like to return the y coordinate for the part surface. to clarify, the surfaces that are shown in the previous image are always planar to the top plane at some distance- i need this dimension from the top plane (the y axis from the origin) to be transfered to text and placed anywhere on the surface in the drawing. i experimented with some code to gather coordinates in the part model but it doesn't return the correct values in the drawing.
hope this helps to clarify and clear things up!
john summers, cswp
system:
sw 2009 sp2.0
dell precision 490
intel xeon 5160@3.00 ghz, dual core
nvidia fx-4600, 6.14.11.6265 driver, dual monitors
windows xp 32 w/ 4 gig memory, 3 gig switch
does this macro do what you need? the notes it creates are just text, not linked dimensions.
let me get this right first. are you working on purely a drawing here i presume?
your problem will be with model-space coordinates and translating from an actual 3d model position to a relative drawing-space coordinate. i had absolute nightmares doing a program for a client not so long ago to get point locations from a drawing, its far far more tricky than simply saying here is my position. you have to use transform and translation matrix, space conversions and a few more tricks depending on the conditions.
how important is this task?
hi josh,
this is exactly what i was looking for!!! it would be nice if it were parametric, but this will do the trick. thanks!!!
john
john summers, cswp
system:
sw 2009 sp2.0
dell precision 490
intel xeon 5160@3.00 ghz, dual core
nvidia fx-4600, 6.14.11.6265 driver, dual monitors
windows xp 32 w/ 4 gig memory, 3 gig switch
luke,
this task is pretty important to us- otherwise, we have to manually transfer every dimension to a text box and type it in. take a look at the macro that josh posted- it works great once you understand how it works (took me a few minutes to figure out the "select other" that it was looking for). i may alter it to be more useful for our needs, but it does the trick!
john summers, cswp
system:
sw 2009 sp2.0
dell precision 490
intel xeon 5160@3.00 ghz, dual core
nvidia fx-4600, 6.14.11.6265 driver, dual monitors
windows xp 32 w/ 4 gig memory, 3 gig switch
john,
glad it fit your needs. there's certainly plenty of room for it to be improved - ui... error trapping... even comments!
i'll get you eh steve, if it's the last thing i dooooo!
john,
what you are doing is just getting 2d drawing points, not actual 3d model points into model space coordinates so what you are asking is very basic it is just a case of getting the selected points as the example macro does. nothing really to comment on as its just a case of getselectionpoint2 and however you want to go about that.
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
回复


主题工具 搜索本主题
搜索本主题:

高级搜索
显示模式

发帖规则
不可以发表新主题
不可以回复主题
不可以上传附件
不可以编辑您的帖子

vB 代码开启
[IMG]代码开启
HTML代码关闭



所有的时间均为北京时间。 现在的时间是 01:42 AM.


于2004年创办,几何尺寸与公差论坛"致力于产品几何量公差标准GD&T | GPS研究/CAD设计/CAM加工/CMM测量"。免责声明:论坛严禁发布色情反动言论及有关违反国家法律法规内容!情节严重者提供其IP,并配合相关部门进行严厉查处,若內容有涉及侵权,请立即联系我们QQ:44671734。注:此论坛须管理员验证方可发帖。
沪ICP备06057009号-2
更多