There are several migrate(Rhino5 to Rhino6) problems


#1

Hi,

There are several migrate(Rhino5 to Rhino6) problems.
Is there document of migration details?

  1. unit type are undefined:
    SP173110-12

  2. How to get rhino_doc_sn when I call “RunScript()” function?
    SP173110-13

  3. class “CRhinoLayer” has no member “LayerName”
    SP173110-14

  4. class “ON_Xform” has no member “Zero”
    SP173110-15

Vaker


(Dale Fugier) #3

Hi @Vaker

Please review the following:

http://developer.rhino3d.com/guides/cpp/whats-new/

1.) unit type are undefined:

switch (Unit)
{
case ON::LengthUnitSystem::None:
  break;
case ON::LengthUnitSystem::Millimeters:
  break;
// Etc...
default:
  break;
}

2.) How to get rhino_doc_sn when I call “RunScript()” function?

CRhinoCommand::result CCommandTes6::RunCommand(const CRhinoCommandContext& context)
{
  const unsigned int rhino_doc_sn = context.m_doc.RuntimeSerialNumber();
  // TODO...

3.) class “CRhinoLayer” has no member “LayerName”

ON_wString layer_name = obj->ObjectLayer().Name();

4.) class “ON_Xform” has no member “Zero”

ON_Xform xform = ON_Xform::ZeroTransformation;

– Dale


#5

Hi @dale,

Thanks for your help.

I still have build error as below:
SP173110-17

Vaker


(Dale Fugier) #6

Use ON_Layer::SetName.

– Dale


#7

Hi @dale,

Thanks for your help.

I still have build error as below:

How to clear all data in document?
“RhinoApp().ActiveDoc()->Destroy();” in Rhino5
The function “Destroy()” become a private function.

How to get (or create) CRhinoCacheHandle when using CRhinoDisplayPipeline::DrawShadedBrep()?

I wnat to get ON_ClippingRegion::m_xform in Rhino5.
Can I use ON_ClippingRegion::ObjectToClipTransformation() to get it in Rhino6?

Vaker


(Dale Fugier) #8

Hi @Vaker,

Wow, I think you’re the only developer whose was brave enough to call CRhinoDoc::Destroy. Is there any reason you cannot just script the New command?

Why do you need or want to do this?

Yes.

– Dale