Hello,
I am looking for a solution to place few blocks along a curve. The blocks need to be aligned in the direction of the curve. This is exactly the same thing done in AutoCAD "Divide" command with "align" option. I would like to achieve this behaviour through ObjectARX API.
I know how to divide a curve through the methods available in AcDbCurve class. But I don't know how to align(rotate) the blocks along the path. Can you guide me with any samples?
Thanks
PremKumar U
Solved! Go to Solution.
Solved by owenwengerd. Go to Solution.
You can use AcDbBlockReference::transformBy() to align a block reference entity to your alignment vector by creating a transformation matrix based on the vector. I don't have any sample code available, but it's not too difficult to figure out by reviewing the API documentation.
Hi Owen,
Thanks for stepping in to reply. Greatly appreciate it.
In the first post, the actual problem is to how to find the transformation -or- the rotation angle -or- alignment vector.
I can think of two possible ways to find it, which I am only conceptually aware of:
I asked the question so that I should not reinvent the wheel, if any (or better) solution exist. Even for the solutions I said above, I do not know how to implement it as well. It would be of immense help if any existing API function can do or any sample code exist.
Many thanks,
Premkumar
You can call AcDbCurve::getFirstDeriv() to get the alignment vector.