Greetings,
I'm currently working on a Lisp script that's supposed to read all the information from entities within the model space of BricsCAD and write it to a file.
With a lot of help from tutorials and very kind helpers in different forums i came pretty far, but now I've reached the point of cleaning up my code and a certain function I call in the script, which is pretty essential began to behave strange.
It's the function to get the information i want from an insert:
When copy it to a test environment, which only calls this one get info function it works clean: takes the list of entities checks every single entity in the list, if its an insert and if it is the function reads out things like Insertion Point, layer, handle, list of sub-entities and so on. The idea of it is, that it doesn't write the list of subentities to the file directly but to call all the get info functions (including the get insert function) so it can read down level by level.
Now in the actual script i don't call every single get info function but a function that calls them all one after another, passing on an input list.
The general algorithm Looks about like this:
- make a list of all entities within the model space (modSpList)
- call (getInfo modSpList)
- inform the user that the script is finished via command line
- end
The getInfo algorithm (assuming we take modSpList as input):
- inform the user that the script beginns to read lines via command line
- call (getLineData modSpList)
- inform the user that the script finished to read lines via command line
- inform the user that the script beginns to read arcs via command line
- call (getArcData modSpList)
- inform the user that the script finished to read arcs via command line
[walk through all types of entities that way]
- inform the user that the script beginns to read inserts via command line
- call (getInsertData modSpList)
- inform the user that the script finished to read inserts via command line
- end
And finally the getInsert algorithm (assuming we take modSpList as input):
- check through all entities in the input list (this case modSpList)
- only handle entities that are inserts
- read out all necessary Information (name, handle, insertion point and so on)
- write those to a file
- create a list of all existing sub-entities (lets call it subEntList)
- call (getInfo subEntList)
- end
See it SHOULD do a clean recursive call but all i get in the generated file is a lot of empty space (line Feeds).
Did I make a misstake in the algorithm from not knowing Lisp to well yet or does it look functioning and the error is within the code?