(c++)How to get the current plug-in path

rhinocommon

#1

Hi:
I want to load some file in the plug-in path, but I am new in c++, how cant ia get the current plug-in path?


(Dale Fugier) #2

You can get the full path to your plug-in by calling your plug-in object’s GetPlugInFileName member.

– Dale


#3

Thinks @dale I am try it now.


#4

Hi @dale :
Cant you give me some sample?
I try it but I do not kown how to usd it :slight_smile:


(Dale Fugier) #5

The CRhinoPlugIn::GetPlugInFileName() function is a member function, not a static function. Thus, in order to call this member function, you will need to have your one-and-only plug-in object.

For example:

BOOL CTestPlugIn::OnLoadPlugIn()
{
  ON_wString filename;
  if (GetPlugInFileName(filename))
  {
    // TODO...
  }
  return CRhinoUtilityPlugIn::OnLoadPlugIn();
}

#6

Hi @dale:
It run good , thinks.