This is Alexander Rivilis's Typepad Profile.
Join Typepad and start following Alexander Rivilis's activity
Alexander Rivilis
Graduated from the Lobachevsky University of the city of Gorky (now Nizhny Novgorod, Russia), the radiophysics department (specialized in quantum radiophysics). Work in the MAESTRO Group (Kiev, Ukraine).Have been member of the Autodesk Developer Network since 1999. I am a programmer, one of the developers of the MAESTRO system. Besides work at my spare time I teach ObjectARX in the Moscow CAD & GIS Academy.
Recent Activity
And what about LIVESECTION was turned on and I need only change color of Intersection Fill?
Is it possible to emulate command LIVESECTION with AutoCAD .NET AP
By Madhukar Moogala This question is coming from one of our beloved Forum contributor and Mentor Alexander Rivilis I am working with code which change color of Intersection Fill of Live Section. But although the color is changed, but this is not visible on the screen until I turn off and tu...
Excellent!
The Property Inspector in depth
By Madhukar Moogala This is an old sample rewritten from ground up by Cyrille Fauvel for AU 2004 While working on case submission from an ADN partner, I got oppturnity to migrate it to current AutoCAD release. Agenda What is the Property Palette? Extending the Property Inspector for existing ...
Oops! Now I can download it. Look like it was a temporary problem.
A simplified .NET API for accessing AutoCAD parameters and constraints
By Philippe Leefsma This post is an updated version of Kean's post about the simplified constraint API we developed a while ago. At the time we posted it, this AutoCAD DevBlog wasn’t existing yet, so the reason why I’m posting that myself today is because, being the main author of that library, ...
Dear Philippe!
File https://adndevblog.typepad.com/adnassocconstraintapi-1.zip is not found. Please re-upload it.
A simplified .NET API for accessing AutoCAD parameters and constraints
By Philippe Leefsma This post is an updated version of Kean's post about the simplified constraint API we developed a while ago. At the time we posted it, this AutoCAD DevBlog wasn’t existing yet, so the reason why I’m posting that myself today is because, being the main author of that library, ...
Thank you, Madhukar!
That is my port to AutoCAD .NET API:
[code]
using System;
using Autodesk.AutoCAD.Runtime;
using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.DatabaseServices;
using Autodesk.AutoCAD.Geometry;
using Autodesk.AutoCAD.EditorInput;
// This line is not mandatory, but improves loading performances
[assembly: CommandClass(typeof(Rivilis.XrefLongTrans))]
namespace Rivilis
{
public class XrefLongTrans
{
enum EditInPlaceXrefState
{
Discarded,
Saved
};
static EditInPlaceXrefState state =
EditInPlaceXrefState.Discarded;
[CommandMethod("WatchXref")]
public void WatchXref()
{
Document doc = Application.DocumentManager.MdiActiveDocument;
if (doc == null) return;
Editor ed = doc.Editor;
LongTransactionManager longTranMan = Application.LongTransactionManager;
longTranMan.CheckedIn += TrMan_CheckedIn;
longTranMan.Aborted += TrMan_Aborted;
doc.CommandEnded += Doc_CommandEnded;
}
[CommandMethod("UnWatchXref")]
public void UnWatchXref()
{
Document doc = Application.DocumentManager.MdiActiveDocument;
if (doc == null) return;
Editor ed = doc.Editor;
LongTransactionManager longTranMan = Application.LongTransactionManager;
longTranMan.CheckedIn -= TrMan_CheckedIn;
longTranMan.Aborted -= TrMan_Aborted;
doc.CommandEnded -= Doc_CommandEnded;
}
private void TrMan_Aborted(object sender, LongTransactionEventArgs e)
{
Document doc = Application.DocumentManager.MdiActiveDocument;
if (doc == null) return;
Editor ed = doc.Editor;
if (e.Transaction.Type == LongTransactionType.XRefDb)
{
ed.WriteMessage("\nLong transaction {0} aborted\n", e.Transaction.LongTransactionName);
state = EditInPlaceXrefState.Discarded;
}
}
private void TrMan_CheckedIn(object sender, LongTransactionEventArgs e)
{
Document doc = Application.DocumentManager.MdiActiveDocument;
if (doc == null) return;
Editor ed = doc.Editor;
if (e.Transaction.Type == LongTransactionType.XRefDb)
{
ed.WriteMessage("\nLong transaction {0} commited\n", e.Transaction.LongTransactionName);
state = EditInPlaceXrefState.Saved;
}
}
private void Doc_CommandEnded(object sender, CommandEventArgs e)
{
if (e.GlobalCommandName.ToUpper() == "REFCLOSE")
{
Document doc = Application.DocumentManager.MdiActiveDocument;
if (doc == null) return;
Editor ed = doc.Editor;
ed.WriteMessage("\nModification of XREF {0}\n",
(state == EditInPlaceXrefState.Saved) ?
"Saved": "Discarded");
}
}
}
}
[/code]
How to Check if XREF Edit In Place–Is Saved or Discarded
By Madhukar Moogala When user edit external reference in place, there is no way to get to know if user had saved the changes or discarded. If your application would like to capture the user intent, for example. if (e.GlobalCommandName == /*MSG0*/"REFCLOSE") { if (save){ //logic 1 } if(discard){ ...
Also ObjectARX Wizard 2019 do unusable ObjectARX Wizard 2017 and 2018. It is very bad news. I have to restore both ObjectARX Wizards manually :(
AutoCAD 2019 ObjectARX and .NET wizards
By Deepak Nadig We have had many users asking for new versions of wizards that are Visual Studio 2017 compatible to work with AutoCAD 2019. Here they are : AutoCAD ObjectARX 2019 Wizard AutoCAD .NET 2019 Wizard P.S: We will soon have these wizards downloadable from the Tools section of https...
File: "C:\Program Files (x86)\Autodesk\ObjectARX 2019 Wizards\ArxWizMFCSupport\HTML\1033\default.htm"
Line 11 have to be commented (or deleted). Otherwise dialog is wrong and impossible press Finish button.
AutoCAD 2019 ObjectARX and .NET wizards
By Deepak Nadig We have had many users asking for new versions of wizards that are Visual Studio 2017 compatible to work with AutoCAD 2019. Here they are : AutoCAD ObjectARX 2019 Wizard AutoCAD .NET 2019 Wizard P.S: We will soon have these wizards downloadable from the Tools section of https...
Other bug:
File: "C:\Program Files (x86)\Autodesk\ObjectARX 2019 Wizards\ArxWizMFCSupport\HTML\1033\default.htm"
In line 336 have to be changed CLASSID to "CLSID:fc1ae18b-0282-42f1-90ae-bbd8f0181013"
AutoCAD 2019 ObjectARX and .NET wizards
By Deepak Nadig We have had many users asking for new versions of wizards that are Visual Studio 2017 compatible to work with AutoCAD 2019. Here they are : AutoCAD ObjectARX 2019 Wizard AutoCAD .NET 2019 Wizard P.S: We will soon have these wizards downloadable from the Tools section of https...
Hi Deepak!
You forgot disable compile option: Smaller type check in debug configuration.
AutoCAD 2019 ObjectARX and .NET wizards
By Deepak Nadig We have had many users asking for new versions of wizards that are Visual Studio 2017 compatible to work with AutoCAD 2019. Here they are : AutoCAD ObjectARX 2019 Wizard AutoCAD .NET 2019 Wizard P.S: We will soon have these wizards downloadable from the Tools section of https...
Yes! I have ObjectARX SDK 2018 from Autodesk website (not beta). File rxsdk_common.props has such line:
_WIN32_IE=0x0600;WIN;WIN32;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_COUNT=1;_AFXDLL;_UNICODE;UNICODE;%(PreprocessorDefinitions)
There is no others preprocessor definitions.
So it is look like best offer - download and install the latest version of the ObjectARX SDK 2018 from Autodesk website: http://usa.autodesk.com/adsk/servlet/item?siteID=123112&id=785550
AutoCAD 2018: Unexpected Behavior Dealing with wchar_t
By Madhukar Moogala Recently I had a request from an ADN partner troubleshooting a problem with reading values from a text file. Assume we have a text file with following contents Helloworld|Autodesk. And, user would like to split string with pipe delimitation, so expected output would be Hello...
Hi, Madhukar!
I've checked my ObjectARXSDK 2018\inc\rxsdk_common.props but did not found _CRT_STDIO_ISO_WIDE_SPECIFIERS definition in it. What wrong with my ObjectARX SDK 2018?
Best Regads,
Alexander Rivilis
AutoCAD 2018: Unexpected Behavior Dealing with wchar_t
By Madhukar Moogala Recently I had a request from an ADN partner troubleshooting a problem with reading values from a text file. Assume we have a text file with following contents Helloworld|Autodesk. And, user would like to split string with pipe delimitation, so expected output would be Hello...
Dear Virupaksha Aithal!
You wrote: "It is required to remove corresponding PDF underlay references from the drawing".
But in your's code there are not any removing of PDFReference's (e.g. pdfref.Erase() ). Only "regen" of PDFReference's.
As far as I see it is enough in order to hide it in drawing: http://autode.sk/2axfW7G
Unload all the PDF underlay
By Virupaksha Aithal Below code shows the procedure to unload all the PDF underlays. It is required to update the corresponding PDF underlay references , so that AutoCAD can update the model space graphics. For this, the “PdfDefinition.GetPersistentReactorIds” API is used to get all the referenc...
>>>Developing Environment for AutoCAD \OEM 2017 is Visual Studio 2017.<<<
I think this is a typo and AutoCAD OEM 2017 require Visual Studio 2015.
Setup Requirements For AutoCAD OEM 2017
By Madhukar Moogala We have been receiving queries on OEM 2017 makewizard, to reach large audience I posting the necessary Visual studio 2015 set up requirements needed for successful build of OEM application. Problem: ‘Next’ button is greyed out in OEM makewizard 2017? Developing Environment f...
P.S.: I've tested this code and find that AutoCAD check this variable from registry every time. So for this variable it is a quite well solution. Thanks!
Change Profile settings from .NET
By Adam Nagy There are many settings which are stored in various parts of the registry folders that AutoCAD is using. Many of them you can also read and write through getenv/setenv in LISP or acedGetEnv/acedSetEnv in ObjectARX - here is a .NET version: http://adndevblog.typepad.com/autocad/2012...
Hi Adam!
As far as I remember AutoCAD read changed registry variables only after it restart (next session) unlike of getenv/setenv. So it is not ideal solution.
Change Profile settings from .NET
By Adam Nagy There are many settings which are stored in various parts of the registry folders that AutoCAD is using. Many of them you can also read and write through getenv/setenv in LISP or acedGetEnv/acedSetEnv in ObjectARX - here is a .NET version: http://adndevblog.typepad.com/autocad/2012...
Dear Augusto!
Another typos:
privatestaticexternvoid
staticpublicvoid
;)
.NET DllImport a method defined in C++
By Augusto Goncalves Suppose there is a void MyFunc() C++ function you need to call from .NET. The DllImport call will only recognize it if the function is declared with dllexport modifier. extern "C" __declspec( dllexport ) void MyFunc() It is also possible pass a .NET AutoCAD Entity to C++ u...
[code]
static void RemExtDict () {
Acad::ErrorStatus es;
ads_name en; ads_point p;
if (acedEntSel(_T("\nSelect Entity with ExtDictionary: "),en,p) != RTNORM)
return;
AcDbObjectId eId; acdbGetObjectId(eId, en);
AcDbEntityPointer pEnt(eId, AcDb::kForRead);
if (pEnt.openStatus() == Acad::eOk) {
AcDbObjectId idExtDict = pEnt->extensionDictionary();
if (idExtDict.isNull() || idExtDict.isErased()) {
acutPrintf(_T("\nEntity has not Extension Dictionary!"));
return;
}
{
AcDbDictionaryPointer pDict(idExtDict, AcDb::kForWrite);
if (pDict.openStatus() == Acad::eOk) {
AcDbObjectIdArray ids; ids.setPhysicalLength(pDict->numEntries()+1);
AcDbDictionaryIterator *pIter = pDict->newIterator();
for (; !pIter->done(); pIter->next()) {
ids.append(pIter->objectId());
}
delete pIter;
for (int i = 0; i < ids.length(); i++) {
pDict->remove(ids[i]);
}
}
}
if (pEnt->upgradeOpen() == Acad::eOk) {
es = pEnt->releaseExtensionDictionary();
if (es != Acad::eOk) {
acutPrintf(_T("\nError releaseExtensionDictionary() = %s"),
acadErrorStatusText(es));
}
}
}
}
[/code]
Removing xdata attached to an entity regardless of the appname
By Balaji Ramamoorthy The following ObjectARX / Lisp code removes XData that is attached to an entity regardless of the APPNAME. Use it with caution and only if you need to do this, since removing XData from an entity without considering the appname may cause plug-ins that rely on them to misbeh...
Both dictionary and xrecord has not appname. What do you mean?
Removing xdata attached to an entity regardless of the appname
By Balaji Ramamoorthy The following ObjectARX / Lisp code removes XData that is attached to an entity regardless of the APPNAME. Use it with caution and only if you need to do this, since removing XData from an entity without considering the appname may cause plug-ins that rely on them to misbeh...
My solution:
{code}
using System;
using Autodesk.AutoCAD.Runtime;
using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.EditorInput;
[assembly: CommandClass(typeof(Rivilis.BEdit))]
namespace Rivilis
{
public class BEdit
{
[CommandMethod("TestBEDIT")]
public void TestBEdit()
{
Document doc =
Application.DocumentManager.MdiActiveDocument;
Editor ed;
if (doc != null)
{
ed = doc.Editor;
if (Autodesk.AutoCAD.Internal.AcAeUtilities.IsInBlockEditor())
{
ed.WriteMessage("\nWe are in block editor of block \"{0}\"",
Autodesk.AutoCAD.Internal.AcAeUtilities.GetBlockName());
}
else
{
ed.WriteMessage("\nWe are NOT in block editor");
}
}
}
}
}
{/code}
Identify the block editing mode in AutoCAD
By Virupaksha Aithal In last couple of weeks we have received quires related to identifying the block editing state in AutoCAD. One approach to identify the state is to read the system variable “BLOCKEDITOR” using GetSystemVariable in .NET or using acedGetVar in ObjectARX. BLOCKEDITOR will be 1 ...
Only ObjectARX 2015 and 2016 have method AcApDocument::getDwgVersionFromSaveFormat
How to Get Default Drawing Format
By Madhukar Moogala I have recently received a query from an ADN partner whether it is possible to get default Save As format details from an API or Command, I’m not sure if we have command to get, but we do have a simple API to get the details. Following tiny code snippet will give details ...
Russian translation of this post and C# sample: http://adn-cis.org/programmnaya-imitacziya-komandyi-burst.html
Programmatically mimic the Burst command
By Balaji Ramamoorthy The "Burst" command from the express tools is quite useful when exploding block references with attributes. Unlike the usual explode command, it leaves the attributes unchanged when a block reference is exploded. Here is a sample code to mimic the Burst command using the Au...
Hi Balaji!
File arxdragdrop.ilk completely superfluous but has size >1Mb
Drag and Drop from a modeless dialog into AutoCAD editor
By Balaji Ramamoorthy ObjectARX 2004 had a nice C++ sample that demonstrates the implementation of drag-drop into AutoCAD both as files from the explorer and from a modeless dialog inside AutoCAD. I have attached the migrated sample for AutoCAD 2016. To try it, appload the arx and run "arxdd" co...
Hi Augusto!
You did the simple typo in your's post. Instead of DBText have to be MText.
Simple drawable overrule skeleton
By Augusto Goncalves We have a few samples of our blog showing how create drawable overrule. But what’s the skeleton to set up? This is actually a recurrent question on our support, so I decided to share what is my recommendation. To make it work you’ll need a class that implements the Drawable...
It is impossible to assign LineWeight to temp line drawn with acedGrDraw / acedGrVecs, but you can offset temp line left and right with value from 0 to Width with appropriate step.
Temporary graphics in AutoCAD
By Balaji Ramamoorthy It usually helps to visually see the results of our geometric computations. ObjectARX and the AutoCAD .Net API provide a few temporary graphics methods that come very handy in such scenario. One way to do this is to use the transient graphics API, but in this post I will ...
Also you can check this code:
http://adn-cis.org/forum/index.php?topic=59.msg4561#msg4561
Intersection between a Surface and a Line using ARX
By Xiaodong Liang In the other post, my colleague Philippe introduces how to get intersection between a planar face and a line. In this post, we will see how to get intersection of an arbitrary surface and a line. ARX provides AcGeCurveSurfInt which allows you to get intersections of a 3D curve...
More...
Subscribe to Alexander Rivilis’s Recent Activity