Getting Japanese Window Reference by Name

Getting Japanese Window Reference by Name

nagahhh
Contributor Contributor
161 Views
2 Replies
Message 1 of 3

Getting Japanese Window Reference by Name

nagahhh
Contributor
Contributor

I can not get the reference by Name.
It is a Japanese window family.
Could anyone give me some advice? 

Here is my code.

public override void GetTopBottomReference()
{
if (Element is not FamilyInstance familyInstance)
return;
 
try
{
TopReference = familyInstance.GetReferenceByName("記号");
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine($"TopReference Getting Error: {ex.Message}");
}
 
try
{
BottomReference = familyInstance.GetReferenceByName("額縁");
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine($"BottomReference Getting Error: {ex.Message}");
}
}

 

0 Likes
Accepted solutions (1)
162 Views
2 Replies
Replies (2)
Message 2 of 3

rcrdzmmrmnn
Advocate
Advocate
Accepted solution

Hello, you need to set the parameter "Is Reference" in the reference plane to something different than "Not a Reference". As written in the API doc:

Returns the family instance reference corresponding to the named reference plane in the instance's family. Returns null if there is no reference plane with this name in the family, or if the plane exists but its "Is Reference" property is "Not a Reference", or if the input string is empty.

0 Likes
Message 3 of 3

nagahhh
Contributor
Contributor

Hello Ricardo-san,

Thank you for your reply. It seems that Is Reference should be set to Top or Bottom in the family in this case. The way Japanese families are created doesn't follow the standard conventions, does it? I have understood the reason, thanks!