乐筑天下

搜索
欢迎各位开发者和用户入驻本平台 尊重版权,从我做起,拒绝盗版,拒绝倒卖 签到、发布资源、邀请好友注册,可以获得银币 请注意保管好自己的密码,避免账户资金被盗
查看: 36|回复: 10

[综合讨论] Autocad 2011: Using a referenc

[复制链接]

2

主题

6

帖子

4

银币

初来乍到

Rank: 1

铜币
10
发表于 2022-7-7 21:35:06 | 显示全部楼层 |阅读模式
Hello
 
I've a problem with Autocad 2011 and parametric design.
 
I want to use a Reference parameter in a costraint's expression.
 
For example, I'm drawing a simple triangle, where A, B, C are sides and alpha, beta, gamma are angles.
 
I can fix the lenght of A and C and the value of alpha (which is the angle between them), so I have a completely constrained triangle.
 
Now, I want to use the value of beta and gamma (which I didn't constrain) in the expression of another object.
I tried to assign a Reference Parameter to beta and gamma, but I can't use them in any expression because
 
 
So, if I can't use them to drive other paramethers, what can I do with reference parameters?
Is there a way to pass an "uncostrained value" as variable in a constraint expression?
 
EDIT: I'm adding a simple draw to explain the case
http://dl.dropbox.com/u/12174476/Triangle.dwg
回复

使用道具 举报

106

主题

1万

帖子

101

银币

顶梁支柱

Rank: 50Rank: 50

铜币
1299
发表于 2022-7-7 21:41:56 | 显示全部楼层
a/sina =b/sinb =c/sinc   
 
sina sine of angle a you should be able to work out the others you have enough known values.
回复

使用道具 举报

2

主题

6

帖子

4

银币

初来乍到

Rank: 1

铜币
10
发表于 2022-7-7 21:51:27 | 显示全部楼层
 
Well, I know, but this was just an example. I've to apply it to geometries which are far more complicated.
It's out of the question to find an expression for it every time I need to use the value of an unconstrained object.
回复

使用道具 举报

3

主题

61

帖子

58

银币

初来乍到

Rank: 1

铜币
16
发表于 2022-7-7 21:54:18 | 显示全部楼层
Only thing I can think of is to grab the number through lisp
 
Try the Lisp thread
 
Hope this helps
回复

使用道具 举报

3

主题

61

帖子

58

银币

初来乍到

Rank: 1

铜币
16
发表于 2022-7-7 22:02:56 | 显示全部楼层
Type this:
(setq ss (ssget)); pick the dimension
 
then
(setq ent (entget (ssname ss 0)))
 
You will get:
 
((-1 . ) (0 . "DIMENSION") (5 . "988") (102 .
"{ACAD_REACTORS") (330 . ) (102 . "}") (330 . name: 7ffff7749f0>) (100 . "AcDbEntity") (67 . 0) (410 . "Model") (8 .
"*ADSK_CONSTRAINTS") (100 . "AcDbDimension") (280 . 0) (10 216.364 100.46 0.0)
(11 216.364 100.46 0.0) (12 0.0 0.0 0.0) (70 . 129) (1 . "(d3=99.6021)") (71 .
5) (72 . 1) (41 . 1.0) (42 . 99.6021) (73 . 0) (74 . 0) (75 . 0) (52 . 0.0) (53
. 0.0) (54 . 0.0) (51 . 0.0) (210 0.0 0.0 1.0) (3 . "STD") (100 .
"AcDbAlignedDimension") (13 141.543 127.632 0.0) (14 201.705 48.2524 0.0) (15
0.0 0.0 0.0) (16 0.0 0.0 0.0) (40 . 0.0) (50 . 0.0))
 
42 = the size
1 = (d3= 'the size')
回复

使用道具 举报

2

主题

6

帖子

4

银币

初来乍到

Rank: 1

铜币
10
发表于 2022-7-7 22:06:14 | 显示全部楼层
 
Ok... I think LISP it's the kind of feature which requirest a little bit of training, specially for a total beginner like me.
I'll try your code and I'll read something around... Thank you.
回复

使用道具 举报

106

主题

1万

帖子

101

银币

顶梁支柱

Rank: 50Rank: 50

铜币
1299
发表于 2022-7-7 22:13:31 | 显示全部楼层
Had a look at your dwg and my first post is still correct for a triangle Its been a long time since I played with parametric's but you should be able to say lengtha legthb ang1 new line length = sin length+100
 
Check out the Autocad help a bit more just had a look at "Dimensional constraint" it shows d1 d2 d3 d4 etc I am pretty sure you could add the sin(a) for d5
 
You may be able to save your constaints so the traingle solution is the first one in a collection.
回复

使用道具 举报

106

主题

1万

帖子

101

银币

顶梁支柱

Rank: 50Rank: 50

铜币
1299
发表于 2022-7-7 22:22:57 | 显示全部楼层
Had a play got all sorts of answers to work d1=A+B+250*sin(alpha) it doesn't like mixing dimensional constraints and refernce paremeters
 
got it to work erased line ? drew line again and did as aligned dim only problem is it will not let me change the length of the line wich I should be able to do its to do with the locking need to constrain but not lock.
 
Bit more drew 2 lines at angles drew 1 line used parametric "dim aligned" picked ends of angle lines used "dim aligned" picked start and end of single line, double click text d1=123.4567 and made it d1=d2+100 which is what you want auto grows auto.
 
What you want is enter angle and length of sides draw new answer and use 3rd side
 
You need the 3rd constraint not locked but to reflect an answer then problem solved need a equivalent to distance between two points via a constraint
回复

使用道具 举报

106

主题

1万

帖子

101

银币

顶梁支柱

Rank: 50Rank: 50

铜币
1299
发表于 2022-7-7 22:26:42 | 显示全部楼层
3rd try yes it can be done but a bit more playing you need a triangle with two angles as parametrics and two kown sides as parametric create a use parameter unknownside =A/sin(a)*Sin(b) this equals unknown side length draw a line
 
Parameter the line and make its value =unknownside+100 change angle or lengths all works because the unknown is calculated not measured and locked.
 
bottom line someone out there know how we can add a expression angle diff between two lines but not as a constraint ?
回复

使用道具 举报

2

主题

6

帖子

4

银币

初来乍到

Rank: 1

铜币
10
发表于 2022-7-7 22:33:03 | 显示全部楼层
 
Generally speaking, I want to use a reference parameter as a variable in a constraints expression without having to find any math expression for it.
Obviously it's always possible to find an expression for a reference parameter, since it is a function of the constraints, but I just don't need it.
 
Actually, I "solved" the problem in this way:
http://dl.dropbox.com/u/12174476/MAM/Esercitazione%204/Fairbairn.dwg
 
The grey vertical lines on the left has the same lenght of the reference parameter I want to use. Everytime I change the position of the white linkage (by changing fi2), the grey line change it's lenght.
So, I'm just copying the value of that lenght into the constraint applied on the green line, and then I'm using that constraint as "variable" in other constraint's expression.
So, I have to use a contraint which is the copy of a reference parameter, and I have to copy it by hand, instead of just using the value of the reference parameter.
 
LISP could probably be a solution, but actually I'll spend more time learning how to do than doing it by hand.
回复

使用道具 举报

发表回复

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

QQ|关于我们|小黑屋|乐筑天下 繁体中文

GMT+8, 2025-3-5 05:02 , Processed in 0.378913 second(s), 72 queries .

© 2020-2025 乐筑天下

联系客服 关注微信 帮助中心 下载APP 返回顶部 返回列表