The Random Argument Input

In the previous implementation, the ordering of arguments mattered. Putting length as second argument after height as the first parameter altered the drawing which was not desired for the user.

Considering the same entity wall, creating few walls like:

wall(l=100,h=30,bx=10,by=10)
wall(h=50,l=120,bx=10,by=40)
wall(bx=20,h=100,by=100,l=60)
,

does not affect the drawing. A vector was created for storing the values of the arguments. The output file I got after splitting removing the delimiters:

wall
l
100
h
30
bx
10
by
10

and similarly for the other two walls, each line is read and the entity name and variable names are compared and pushed to a vector. After one entity is read completely, it is pushed to another vector which stores the complete data of one entity as a single entry. This data is then extracted to obtain the values of variables, passing them to function that writes to DXF file and create the final drawing.

It can be referred here: https://github.com/kamalpreetgrewal/textToDrawing.

Leave a Reply

Follow

Get notified with the latest posts

Plugin Supporter WordPress Post Navigation
%d bloggers like this: