-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
37 changed files
with
289 additions
and
216 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#include "stdafx.h" | ||
#include "PyAcadApplication.h" | ||
#include "PyAcadApplicationImpl.h" | ||
|
||
bool PyAcadApplication::runTest() | ||
{ | ||
return PyAcadApplicationImpl::runTest(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#pragma once | ||
|
||
#ifdef PYRXDEBUG | ||
class PyAcadApplication | ||
{ | ||
public: | ||
static bool runTest(); | ||
}; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
#include "stdafx.h" | ||
#include "PyAcadApplicationImpl.h" | ||
|
||
|
||
#ifdef PYRXDEBUG | ||
#include "propvarutil.h" | ||
|
||
PyAcadApplicationImpl::PyAcadApplicationImpl() | ||
: m_pimpl(acedGetIDispatch(FALSE)) | ||
{ | ||
} | ||
|
||
void PyAcadApplicationImpl::Eval(const CString& csVal) const | ||
{ | ||
_bstr_t bstrVal{ csVal }; | ||
PyThrowBadHr(impObj()->Eval(bstrVal)); | ||
} | ||
|
||
std::vector<std::wstring> PyAcadApplicationImpl::ListArx() | ||
{ | ||
VARIANT rtVal; | ||
VariantInit(&rtVal); | ||
#if defined(_ZRXTARGET) | ||
PyThrowBadHr(impObj()->ListZrx(&rtVal)); | ||
#elif defined(_GRXTARGET) | ||
PyThrowBadHr(impObj()->ListGrx(&rtVal)); | ||
#else | ||
PyThrowBadHr(impObj()->ListArx(&rtVal)); | ||
#endif | ||
ULONG pcElem = 0; | ||
PWSTR* prgsz = nullptr; | ||
std::vector<std::wstring> vec; | ||
if (VariantToStringArrayAlloc(rtVal, &prgsz, &pcElem) == S_OK) | ||
{ | ||
vec = std::vector<std::wstring>(prgsz, prgsz + pcElem); | ||
CoTaskMemFree(prgsz); | ||
} | ||
return vec; | ||
} | ||
|
||
bool PyAcadApplicationImpl::runTest() | ||
{ | ||
PyAcadApplicationImpl app; | ||
for (const auto& item : app.ListArx()) | ||
acutPrintf(_T("\n%ls"), item.c_str()); | ||
return true; | ||
} | ||
|
||
IAcadApplication* PyAcadApplicationImpl::impObj(const std::source_location& src /*= std::source_location::current()*/) const | ||
{ | ||
if (m_pimpl == nullptr) [[unlikely]] { | ||
throw PyNullObject(src); | ||
} | ||
return static_cast<IAcadApplication*>(m_pimpl.GetInterfacePtr()); | ||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#include "stdafx.h" | ||
#include "PyAcadDatabase.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
|
||
#ifdef PYRXDEBUG | ||
|
||
class PyAxDatabase | ||
class PyAcadDatabase | ||
{ | ||
}; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#include "stdafx.h" | ||
#include "PyAcadDatabaseImpl.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
#pragma once | ||
|
||
#ifdef PYRXDEBUG | ||
class PyAxDatabaseImpl | ||
class PyAcadDatabaseImpl | ||
{ | ||
}; | ||
#endif |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.