AxdDimensionUtil::getDimensionAttributeValueSetId(PassValue);
//PassValue can be a container or Structure
//below examples are for your reference
kiwiaxguy.blogspot.com/.../setting-default-dimension-using-code.html
mfmujahidmim.wordpress.com/.../create-new-default-dimension-in-ax-2012-using-x-code
blogs.msdn.com/.../creating-general-journals-in-ax-2012-in-x.aspx