Hallo all. I need to import a cga to another cga, and still be able to link with the object attributes.
I got a lot af calculations that I would like to do in a separate cga. So let's take the easy version to describe my issue.
I got a rule called calculation.cga. could look like this.
attr Height = 1
in my polygons I have a object attribute called height, so my attr height gets updated automatically with the value from my polygons.
Then I have a cga called mass.cga. like this:
import calc : "calculation.cga"
I'll need to assign my mass.cga to my polygons. That will give an extrusion of 1. If I change it a bit to se what's going on and create the attr Height = calc.Height
It tells me that now it's looking to link for calc.Height.
That makes somehow sense, but is it possible to link attributes through another rule?
Then I thought to assign the calculation.cga to my polygons, and then pass the the shape to mass.cga, that would create the link right, but I would get a loop of imports. Calculation.cga wouls import mass.cga and mass.cga would import calculation.cga, that don't seem to be allowed.
any thoughts would be much appreciated.
the goal is to make my cga files more understandable, easier to change, and better overview in the inspector.
So my thought was to have all my calculations in one cga, there's a lot, and I often lose track of what is going on where. Then have a roof.cga and a facade.cga that uses the calculations as input.
But I think I need to rethink that
Sendt fra min Samsung-enhed
All solid goals that I am shooting for myself. I import rules very often. I have some rules that have nothing but calculations and reference functions.
By "what goals?", I was actually talking nuts and bolts, like why are you needing to import both ways? In any case, here's some basic info.
1. You can pass geometry into imported rules, but you can't bring it back. In other words, there are no functions that return geometry, even in the same rule.
2. If an imported rule has attributes (hidden or visible) that match the importing rule's, then imported rule values will inherit values from the importing rule.
3. You can set attributes, call functions, and send geometry to rules using the ID in the import statement.
4. You can have functions in the imported rule return values, like strings and numbers, back to the importing rule. To do this you would usually be using parameterized functions, or functions that use attributes or constants in the imported rule. (but not using values in the importing rule, unless those must be passed in via one of the aforementioned methods.
etc. There is more, but that's off the top of my head.