- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm developing a Revit add-in to import models from a 3rd-party format. The code is already written and running on several (OS+BIM) platforms in C++ and I've essentially been filling in the gaps for the wrapper layer for Revit. The add-in is working to the point that it reads the file and creates Levels in Revit for the geometry to be attached to. So far so good.
But I've hit an unexpected snag. There's probably an easy answer, but I haven't got to the bottom of it yet: the constructor for an XYZ object in C++ should have two forms:
1) public : XYZ()
Member of Autodesk::Revit::DB::XYZ
Summary:
Creates a default XYZ with the values (0, 0, 0).
2) public : XYZ(double x, double y, double z)
Member of Autodesk::Revit::DB::XYZ
Summary:
Creates an XYZ with the supplied coordinates.
Parameters:
x: The first coordinate.
y: The second coordinate.
z: The third coordinate.
However, VS does not seem to acknowledge the existence of the second. If I try something like:
auto test = gcnew XYZ(0.0, 1.0, 2.0);
…I get an error that there are "too many arguments". The only constructor that works is the default, i.e. XYZ().
The XYZ class has no mutating functions that would allow a default to be created and then set the x/y/z coords either. All the Revit API documentation says the second constructor exists, but any examples using it are all in C# or VB.
Any suggestions?
Solved! Go to Solution.