I am working on an AutoLISP program that will take one user input (a job number--e.g. 23-4817), and then use that you pull data from text documents (reports generated by engineering software) in order to draw an anchor bolt plan for a metal building. I have the start of something that works, but I feel like there may be a better way to do this.
Currently, I am defining points based on extracted data and using entmake to create the geometry. See attached image of the basic layout that shows the boundary lines and rigid frame center lines. I labeled the points to keep track of them.
Here is an example of the data I have to pull from:
LAYOUT:
-------
Bay Design ---Lap(ft)--
Id Part Length Left Right
---- -------- ------ ----- -----
LExt 8X25Z13 1.17
1 8X25Z13 22.58 3.00
2 8X25Z16 23.75 3.00 2.00
3 8X25Z16 23.75 2.00 2.00
4 8X25Z16 23.75 2.00 3.00
5 8X25Z13 23.83 3.00
RExt 8X25Z13 1.17
Here is an example of the code I am using to make this work:
(strcat "J:/x800/" JobNum
"/RoofDes.out") ;reopens first file "r")
)
(/= b1_line " LAYOUT:");finds a certain line in the file
)
)
(repeat 6 ;goes down another 6 lines )
)
(substr b1_line
22 6);extracts distance from rigid frame offset to first bay of bldg. )
)
(* bay1 12)
)
(+ bay1 rfo);redefines bay1 to include rigid frame offset as part of the total bay width
)
(setq p7
(list bay1 z z
));sets coordinates for first bay line to be drawn ;The next if statement sets it up to draw rigid frame center lines until a certain point, then
;it will not draw any more. This is to allow for projects that have different numbers of bays.
(/= bay1
(- le rfo) ;if bay1 is NOT equal to bldg length - rigid frame offset then...
)
)
)
)
The IF statement near the end is what I think needs some work. Some projects will have more or less bays and different spacings, so I need to have a way to stop reading lines and making entities. This way of doing it all feels to bulky and messy. I am open to any thoughts or suggestions!