Autocad 2011: Using a referenc
HelloI'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 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.
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. Only thing I can think of is to grab the number through lisp
Try the Lisp thread
Hope this helps 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')
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. 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. 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 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 ?
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.
页:
[1]
2