[CONNECT U11] Dimension API

My code to add a Dimension Style from a .dgnlib to the model is failing with a return code of 32768:

pDimStyle = DimensionStyle::GetByName(L"Architectural", StyleIteratorMode::ActiveFileOnly);
wprintf(L"pDimStyle=%p, pDimStyle.IsValid()=%d, pDimStyle.IsNull()=%d\n", pDimStyle, pDimStyle.IsValid(), pDimStyle.IsNull());
if (!pDimStyle.IsValid() || pDimStyle.IsNull())
{   // DimStyle NOT in current active file
	wprintf(L"Style [%s] NOT found in the file\n", L"Architectural");
	pDimStyle = DimensionStyle::GetByName(L"Architectural", StyleIteratorMode::LibrariesOnly);
	if (pDimStyle.IsValid() && !pDimStyle.IsNull())
	{   // DimStyle FOUND in library. Save it to current file
		// add to local file
		iStatus = pDimStyle->Add();	// 32768=??
		wprintf(L"pDimStyle->Add(), iStatus=%d\n", iStatus);
	}
	else
	{
		mdlDialog_openInfoBox(L"Error: Dimension Style Name Not Found.");
		return;
	}
}

Not sure what's going on here. It seems I can CREATE a new Dimension Style and add it to the model.

Bruce

Parents Reply Children