Error message when loading model

All topics on coding 4Dscript in Enterprise Dynamics.
Post Reply
Joeri
Posts: 1
Joined: Sunday 06 March, 2011 - 11:55

Error message when loading model

Post by Joeri »

Hi,

I have made a model with a CircleDiagram in it and two Initialize atoms. The first Initialize atom does a Dim([atmCircleDiagram], ...) so the Sink can do CircleDiagram_IncreaseSegmentScore(atmCircleDiagram, 1, 1). The second Initialize is used to clear the circle diagram on reset.

It worked yesterday but if I now load the model I get the following Error Messages:

1 Compile error: "atmCircleDiagram" is not a valid expression. Reference: if(Age(i)<12,CircleDiagram_IncreaseSegmentScore(atmCircleDiagram,1,1),CircleDiagram_IncreaseSegmentScore(atmCircleDiagram,2,1)) (KernelFnc)
2 Compile error: "atmCircleDiagram" is not a valid expression. Reference: if(Age(i)<12,CircleDiagram_IncreaseSegmentScore(atmCircleDiagram,1,1),CircleDiagram_IncreaseSegmentScore(atmCircleDiagram,2,1)) (KernelFnc)
3 Could not set expression to attribute 'EntryTrigger' on atom 'Sink4'. (KernelFnc)

What am I doing wrong?

Joeri
WU1
Posts: 5
Joined: Monday 28 February, 2011 - 11:37

Re: Error message when loading model

Post by WU1 »

Maybe the occurence of such an error depends on the order in which the atoms are loaded into the model. If so changing the order of the atoms in the model tree will resolve this problem.
User avatar
Fred
Posts: 22
Joined: Wednesday 17 November, 2010 - 12:06

Re: Error message when loading model

Post by Fred »

You are right.

The sequence of the atoms in the tree is important in this case. Make sure that the initialize atom that defines the variables is before the initialize atom that uses the variable in the tree.
Anneke
Posts: 2
Joined: Monday 10 June, 2013 - 10:50

Re: Error message when loading model

Post by Anneke »

Hi,

I have a similar problem as Joeri stated in his post. How can I change the sequence of the atoms in the tree? Just select and drag the atoms in the Model Tree does not work.

However, when I add or remove some spaces in the 4DS code at each atom, the problem is solved. But I have to do this every time I open my model.

Anneke
marlies
Posts: 301
Joined: Monday 17 January, 2011 - 09:28

Re: Error message when loading model

Post by marlies »

Hi Anneke,

You can change the sequence in the tree as follows:
- Select the atom that you want to change in the model tree.
- Open the interact window (shift + F6)
- Use the code setrank( 1, treeatom) to place the atom at rank 1 or replace it by another rank.

However, the spaces you mention could be another problem: it is not possible to declare reference names with spaces in it. If the ranking doesn't solve the problem, could you explain a bit more where you need to remove these spaces?

Regards, Marlies
Anneke
Posts: 2
Joined: Monday 10 June, 2013 - 10:50

Re: Error message when loading model

Post by Anneke »

Hi Marlies,

Thanks for your fast reply! I have moved the ExcelActiveX atom up in the Model Tree, and a lot of errors were gone. About the white spaces in my 4ds code: I had some extra spaces at the end of each code, and when I removed / added some everything worked until I closed the model. But I don't have to do that anymore. ;)

But there are still some errors which aren't fixed: I had made a Table 'A&B' and made an alias of it and used it to refer to. This did not work, so I removed the '&' sign from the Table and Alias name (='AB'). The referencing works now fine, but still get errors like:
- "Compile error: 'setA' is not a valid expression. Reference: cell(p(1), p(2), refA&B) (KernelFnc)"
- "Compile error: Statement 'B' has 0 parameters, must be 1 Reference: cell(p(1), p(2), refA&B) (KernelFnc)"
- "Error registering function 'A&B' to atom 'AB'. Check code. (KernelFnc)"

Do you know how to fix these errors?

Anneke
marlies
Posts: 301
Joined: Monday 17 January, 2011 - 09:28

Re: Error message when loading model

Post by marlies »

Hi Anneke,

I think that something went wrong with the unregistration of the functions A&B and SetA&B. To get rid of it I would suggest to remove this table from your model and afterwards add a new one.

Regards, Marlies
Post Reply