[Question] Fatal error during script execution

Balises:
  • Smart
  • Part
  • Fatal
  • Error

Hi everyone,

I have a problem with smart part editor when I run the script everything in 3d and 2d model disappears. I can see the warning like in attachment (issue nr3). There the new icon appear which I highlighted and all parameters are gone. I have no idea what is going on. Furthermore e.g. in Master Script some basic fuctions are missing (issue nr4) like ATAN which was normally working and was highlighted on blue color like this INT currently is.
I'm attaching also my SP settings.

I've noticed that this kind of error occurs anytime when i tring to add the certain thing. When I wont add that whing everything going well.
I have to add that those things which I'm talking about are really basic like adding a new parameter, using IF statement or PARAMETERS.

Rewriting whole script tp the new (empty) one doesn't help. I've tried.
If someone was dealing with this problem before please help me.

Thank you in advance for helping me.

Pièces-jointes (3)

Type: image/png
Téléchargé 38 fois
Size: 17,80 KiB
Type: image/png
Téléchargé 34 fois
Size: 3,06 KiB
Type: image/png
Téléchargé 21 fois
Size: 29,21 KiB

Hello there again,

since the last post, I have figured out some way how to avoid major issues but it still doesn't solve the problem in general. It is possible to avoid that mistake by built-in "Reset" function in the SP editor. After clicking it we are using every previous setting like in the attachment (solution_nr1). After such a move everything seems to work correctly until it going to happen again. However, this method works every time when I've tried so even if will be necessary to Reset the SP really frequently it is possible to continue typing the script.

Still fetching the right solution

Pièces-jointes (1)

Type: image/png
Téléchargé 12 fois
Size: 58,52 KiB

Hello,

What is the Allplan version?
Did you reinstall Allplan with the full setup to be sure everything is installed?
Can you attach here your SmartPart to have a look at the code?


I have been working on 3 diffrent version of Allplan one of them is 2021-0-3. I have also tried 2023.

I did not try.

Unfortunatelly I cannot attach the file, I know that could help. Inside the script are only really simple function such a loops, conditions, dim variable and that is it. Nothing more, there is no any fancy fucntion which connecting two different SP files or something like that.

Hello,

Without seeing the whole code, or at least extracts of the parts that have problems, it's impossible to give an opinion.
I've been developing SmartParts for over 12 years, and I've never encountered this problem.
The only possibility is that hidden characters have been inserted when copying and pasting. Select the last correct line and the next incorrect one. When selecting, if hidden characters have been added, they will be stealthily visible.


Hi,

I know but I am obligated to not reveal the code. I was not copying and pasting anything, this code has been written by me entirely from scratch. So if somehow something has been implemented into my script (maybe one day I have pasted something but I do not remember this) I do not know about this. Now this is causing that issue, puzzles me, why the SP editor debugger does not catch that error.
Should be like any unknown character stops the script, should not it?
Sometimes when I am testing is like everything is working, I am typing in the variables, and moving the handles, and then is that moment when I writing in one line of code or I am adding one parameter (sometimes I am creating a new parameter and script is not working but when I do even small correction in name of the parameter then is working) and the script stops.
So, I am wondering how it is even possible that that script is working to some point and then stops.

When I read what I typed here I am not sure that will be understandable. However, there are so many small weird errors inside that SP that is so hard for me to explain when they occur. I will try to prepare a more extensive explanation of this when I would have more time for it.

Best regards.