Hi @leeminardi ,
I do apologize for my murky posts.
I should have been clearer on what I wanted to do. I'll try to be more precise in the future.
Post #7 - Yes the Y axis of the block will always be parallel to the XY plane.
Post #11 - I do realize now that saying "adding legs to conveyors" in the first post was not at all sufficient. I do mean positive and negative slope of the blocks.
Post #13 - before this point I was trying to make the code work for a single block. Which I managed to do thanks to all of your answers! At this point I was adding the multiple blocks to a single block as needed them -spacing and all- to that single block and getting the end result I need for a single block - be it in a +ve or -ve slope or parallel to XY plane in all z axis rotations.
Then I started modifying it to work with multiple blocks and realized nentsel wouldn't work on multiple blocks, and so started looking at how to get the same x_dir, y_dir and z_dir without using nentsel. Lets just say last two days have refreshed my memory of matrices and vectors a lot, though still not enough. And now I have a better understanding of how the entities' location and rotation are handled in AutoCAD.
When I stated the "need to add legs to the block" in Post #17 - I was clarifying the original post where I said "Adding legs to conveyors" - to convey what exactly I was trying to do. By which point I had the adding legs at intervals part figured out but needed the X axis of the block angle to XY plane of WCS to calculate the insertion points for the legs and angle of projection of X axis of the block to the X axis of the WCS for the rotation of the block.
And the summary,
1. Inserting multiple blocks positioned along the x axis of the block and to their length - struggling to get the angle (x axis of block to xy plane of WCS) if the block has +ve/-ve slope along x axis.
spacing and number of instances of which are to be calculated by the code - I have this working already.
Part about z axis and x axis is correct. - struggling to get the angle (x axis projected onto XY plane to the x axis of WCS). I'm rotating the blocks using Rotate3D.
Currently I'm trying the code written by Gile in Post #18, and will let you know how it goes.
Hope I'm not confusing everything even further with this post.
Again, I'm really thankful for all your help and will try to be clearer in the future.