LabelSetId not available in Alignment class?

LabelSetId not available in Alignment class?

soonhui
Advisor Advisor
294 Views
3 Replies
Message 1 of 4

LabelSetId not available in Alignment class?

soonhui
Advisor
Advisor

It seems that LabelSetId is not available for retrieval in Alignment class? But I do remember setting it in constructor, so can we expose it?

##########

Ngu Soon Hui

##########

I'm the Benevolent Dictator for Life for MiTS Software. Read more here


I also setup Civil WHIZ in order to share what I learnt about Civil 3D
0 Likes
Accepted solutions (2)
295 Views
3 Replies
Replies (3)
Message 2 of 4

norman.yuan
Mentor
Mentor
Accepted solution

Yeah, since every Alignment.Create() static method requires LabelSet as input, it is very annoyed that Alignment class does not expose it as a read-only property. Yes, in order to find out what LabelSet is associated to an Alignment, we need to write quite complicated code to dig this piece of information out: get the LabelType and StyleName of one of the AlignmentLabelGroup, and then go though all AlignmentLabelSetStyles to see if the LabelSetStyle has a BaseLabelSetItem with same LabelStyleName and LableStyleType as the group's. Obviously, the code needs to go through nested loops to find the match. Autodesk definitely wants to make our work as hard as it gets by not simply expose it after an Alignment is created with this information is a required input.

Norman Yuan

Drive CAD With Code

EESignature

Message 3 of 4

soonhui
Advisor
Advisor

@norman.yuan , we need to thank Autodesk for making us exercise our brain more so that we can always remain sharp. 

##########

Ngu Soon Hui

##########

I'm the Benevolent Dictator for Life for MiTS Software. Read more here


I also setup Civil WHIZ in order to share what I learnt about Civil 3D
0 Likes
Message 4 of 4

soonhui
Advisor
Advisor
Accepted solution

I've written a blog post based on @norman.yuan 's idea. Hopefully it's of use to others. 

##########

Ngu Soon Hui

##########

I'm the Benevolent Dictator for Life for MiTS Software. Read more here


I also setup Civil WHIZ in order to share what I learnt about Civil 3D
0 Likes