#Help Python: Get Parent Alignment of Offset Alignment

Hello,

Can i get some help to know the parent alignment if offset alignment is selected from the drawing ?

I got to know that its stored at this API function ( i might be wrong)

but not able to figure out, how to get the parent alignment from all the info stored there.

Thanks for all the support.

Yep, you’re close. If you drill down into the OffsetAlignmentInfo class, you’ll see there is a property for ParentAlignmentId, which is the Object ID of the parent alignment. So here’s what the pseudocode would look like:

# This is the input
offsetAlign
# Get the offset info
offsetInfo = offsetAlign.OffsetAlignmentInfo
# Get the parent ID
parentAlignId = offsetInfo.ParentAlignmentId
# Get the alignment object via transaction
parentAlign = transaction.GetObject(parentAlignId, OpenMode...)
5 Likes

Thanks man,

Good to know that i was on right tack just needed little push to get to the result.

1 Like