What is the error message you get?
if(T)
{
var file_name = "";
if (P != "")
{
file_name = P;
var bitmap = RhinoDoc.ActiveDoc.Views.ActiveView.CaptureToBitmap(false, false, false);
bitmap.Save(file_name);
}
}
its most probably the same function just for revit…
oh, and you probably want to use a button instead of a boolean switch
hope that helps
Ben
Error (CS0103): Name “Revit” does not exist in the current context (line 62)
Thank you. Let me see
But this is a screenshot from Rhino, not Revit
oh, in this case you are missing to import a library like:
using Autodesk.Revit;
or
using Autodesk;
idk the exact reference
Yeah, I thought you need use my code, but replace
RhinoDoc.ActiveDoc
by
Revit.RevitDoc
but in fact you need to add:
using Autodesk;
or change your command to:
Autodesk.Revit.RevitDoc.ActiveView.CaptureToBitmap(new Size(7620,4380).Save(file);
Ok, I’ll try
It still doesn’t work.
I had a typo, sry.
if(T)
{
var file_name = "";
if (P != "")
{
file_name = P;
var bitmap = Autodesk.Revit.RevitDoc.Views.ActiveView.CaptureToBitmap(new Size(7620,4380));
bitmap.Save(file_name);
}
}
whats the error message now?
I guess you did the following steps, right?
https://www.rhino3d.com/inside/revit/beta/guides/rir-csharp
then if you type ‘Revit.’ a list of available commands should appear. If it doesn’t propose ‘RevitDoc’, then ‘Views’ etc, it’s not the correct command.
Yeah, I’ll take a look sometime
Hi @3388160834,
Rhino.Inside comes with this component.
Does it do what your are looking for?
Here the code: