Sam Jones Posted December 3, 2021 Share Posted December 3, 2021 Why does the script below not associate the created dimensions with the selected symbols and PIOs (line 33) The dimension are created and seem to be correct, but when I select a dimensioned object and move it, the associated dimension does not move with it I have attached a file that contains the script, "Dimension Test", and selected Lighting Devices to dimension. {Line 1} PROCEDURE AssociateDims; TYPE AnObject = STRUCTURE ObjHdl :HANDLE; X :REAL; Y :REAL; END; {AnObject} VAR ObjArray :ARRAY[1..10] OF AnObject; Obj :HANDLE; ObjCount :INTEGER; Index :INTEGER; BEGIN ObjCount := 0; Obj := FSActLayer; WHILE Obj <> NIL DO {Fill ObjArray with selected objects} BEGIN IF ((GetType(Obj) = 15) | (GetType(Obj) = 86)) THEN BEGIN ObjCount := ObjCount + 1; ObjArray[ObjCount].ObjHdl := Obj; GetSymLoc(Obj, ObjArray[ObjCount].X, ObjArray[ObjCount].Y) END; {IF ((GetType(Obj) = 15) |} Obj := NextSObj(Obj); END; {WHILE Obj <> NIL} FOR Index := 1 TO ObjCount DO {Place Dimension from X=0 to Object X} BEGIN LinearDim(0, ObjArray[Index].Y, ObjArray[Index].X, ObjArray[Index].Y, 24, 0, 770, 514, 1); {line 33} AssociateLinearDimension(LNewObj, FALSE); END; END; RUN(AssociateDims); Associate Dimension Test 2021.vwx Quote Link to comment
MullinRJ Posted December 3, 2021 Share Posted December 3, 2021 Hey Sam, Like you, it did not at first make sense to me either, but with a little experimentation it appears both ends of the dimension need to be on the object for the association to stick. I am surprised there is not a similar call that requires 2 handles to specify the object AND the dimension. Oh well, c'est la vie. I've never used this, but have you played with AddAssociation()? The documentation is no worse than that of AssociateLinearDimension(). Raymond Quote Link to comment
Sam Jones Posted December 3, 2021 Author Share Posted December 3, 2021 (edited) 16 hours ago, MullinRJ said: but have you played with AddAssociation()? I have played with AddAssociation with the kOnDeleteDelete and kOnDeleteReset flags in several other commands. There don't seem to be any other flags that I can find, although I'm sure there are some. I doubt that there is a flag that would replace AssociateLinearDimension() routine. The most frustrating thing is that I got AssociateLinearDimension(LNewObj, FALSE); to work 10 days ago. I have both recreated and retrieved from Time Machine the code from then, and still nothing works. The example I sent dimensions the selected symbols and PIOs from center, adding an association to each. Why doen't it work. I guess I'll submit a bug, but I did get it to work once upon a time. Edited December 3, 2021 by Sam Jones add clarifying phrase Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.