This is Fenton Webb's Typepad Profile.
Join Typepad and start following Fenton Webb's activity
Fenton Webb
San Francisco
Recent Activity
Transactions allow you to open the same object for write, multiple times. Normal open for write does not allow this, you get an eWasOpenForWrite error message.
Layered rollbacks are when you nest Transactions, you can undo a pending transaction without affecting the encapsulating transation
The Right Tools for the Job – AutoCAD Part 5
by Fenton Webb Leading on from Part 4, and staying with ‘Performance’ I wanted to take a look at some .NET code and show you how to access the DWG database in the fastest way. Over the years, I’m sure some of you have noticed how I like to write my DWG Database .NET in a very similar way to any ...
Correct, you should consider this fact when coding this way
The Right Tools for the Job – AutoCAD Part 5
by Fenton Webb Leading on from Part 4, and staying with ‘Performance’ I wanted to take a look at some .NET code and show you how to access the DWG database in the fastest way. Over the years, I’m sure some of you have noticed how I like to write my DWG Database .NET in a very similar way to any ...
Hey Steve
yes, there was a reason for it. C was a prototype version of AutoCAD which was released as a preview, but not yet rolled into the main line.
Registry values for ProductID and LocaleID for AutoCAD and the vertical products
By Virupaksha Aithal HKEY_LOCAL_MACHINE\Software\Autodesk\AutoCAD\R20.0\ACAD-E001:409 What is ACAD-E001:409? R20.0 is the release number, the this corresponds to AutoCAD 2015 These digits like E000:409 are a ProductID (E000) and a LocaleID (409). The ProductID structure is a 4-digit value. Howev...
The Export to FBX will only work if the drawing loaded can actually be exported as FBX. try the same commands in normal AutoCAD with the same DWG file
Full listing of available commands for AutoCAD OEM 2013 - A to D
by Fenton Webb Here is a complete listing of all the available commands in AutoCAD OEM 2013; remember, there are differences between full AutoCAD and AutoCAD OEM… Commands A-D _3d Creates three-dimensional polygon mesh objects _3dalign Dynamically aligns objects with other objects in 3D ...
Hey Blackbox!
sorry, I was on vacation yesterday.
I can see that the CUIX copies can be annoying. The reason they are copied is so that users can edit them. if something isn't being cleaned up on bundle uninstall, then that's something that needs to be addressed. However, I do believe that 2013/2014 versions do a better job of cleaning up, and even the latest sp of 2012 does also - have you checked?
Feel free to open a DevHelp online request to discuss/solve these issues.
Autodesk Autoloader White Paper
by Fenton Webb Here’s a draft White Paper for the Autodesk Autoloader, please feel free to comment but before you do please consider these points: 1) The Autoloader is designed to simplify 90% of all Autodesk application deployments and is built on-top-of any existing plugin architectures. If th...
Hey Blackbox!
the Autoloader does not implement any custom code, it merely brings together existing APIs together to standardize their access.
What you are seeing with the copying is a standard per-user way that AutoCAD deals with those who change their UI.
AutoCAD should remove all references of partial CUIXs within a bundle when the bundle is removed. if it's not, please log a DevHelp and we'll get to it ASAP.
Also, please do tell how you would prefer it to work, bearing in mind the above, and I'll gladly present it to engineering for review...
#WaitingForIdeas
Autodesk Autoloader White Paper
by Fenton Webb Here’s a draft White Paper for the Autodesk Autoloader, please feel free to comment but before you do please consider these points: 1) The Autoloader is designed to simplify 90% of all Autodesk application deployments and is built on-top-of any existing plugin architectures. If th...
that was me, not Stephen by the way - he was logged into my machine by accident :-)
Autodesk Autoloader White Paper
by Fenton Webb Here’s a draft White Paper for the Autodesk Autoloader, please feel free to comment but before you do please consider these points: 1) The Autoloader is designed to simplify 90% of all Autodesk application deployments and is built on-top-of any existing plugin architectures. If th...
for your second comment, you don't need to call acdbModifyPointCloudDataView() as the filter is already applied. My call to onModified will queue the graphics refresh at the next asynchronous graphics update.
Creating a Point Cloud Spatial Filter/Clipping box using ObjectARX
by Fenton Webb In order to create a Point Cloud clipping region you must use the C++ ObjectARX API as there is no equivalent .NET API. This is mainly due to performance reasons. All you do is specify a filter callback for a given Point Cloud entity using the acdbModifyPointCloudDataView() functi...
Hey Xerion
yes, you are right, the snapping will be disabled.
To get round the problem, simply close the point cloud after the acdbResetPointCloudDataView() then reopen before acdbModifyPointCloudDataView()
Creating a Point Cloud Spatial Filter/Clipping box using ObjectARX
by Fenton Webb In order to create a Point Cloud clipping region you must use the C++ ObjectARX API as there is no equivalent .NET API. This is mainly due to performance reasons. All you do is specify a filter callback for a given Point Cloud entity using the acdbModifyPointCloudDataView() functi...
Hi Christian
as I have mentioned before in my Tools for the Job (starting at Part 3 Performance http://adndevblog.typepad.com/autocad/2012/07/the-right-tools-for-the-job-autocad-part-3.html) don't use StartTransaction() for utility functions. The overhead for calling StartTransaction() is huge, instead, use StartOpenCloseTransaction()
My personal preference is to use Open/Close directly.
Removing a vertex from AcDb2dPolyline using ObjectARX?
By Fenton Webb Issue Is there any way to remove a vertex from AcDb2dPolyline/AcDb3dPolyline (similar to AcDbPolyline::removeVertexAt() ) ? Solution There is no analogous removal function for 2d and 3d polylines, mainly because the storage mechanisms are different. AcDbPolyline more efficiently...
Hey Christian
Actually, in this case it's probably over kill - that code was left over from the code that I ported this sample from. Apologies there...
That said, yes, all ObjectID's remain 'alive' in the DB even after being erased. That's because the operation can be undone, redone, and undone again - so it's much more efficient to store an 'erased' flag rather than the whole object in the undo filer
Removing a vertex from AcDb2dPolyline using ObjectARX?
By Fenton Webb Issue Is there any way to remove a vertex from AcDb2dPolyline/AcDb3dPolyline (similar to AcDbPolyline::removeVertexAt() ) ? Solution There is no analogous removal function for 2d and 3d polylines, mainly because the storage mechanisms are different. AcDbPolyline more efficiently...
Hey Loic!
you are absolutely right, regenAbort() informs you when you should not waste anymore time creating your geometry.
Thanks for the reminder, it seems you got a lot out of this one which is nice to hear
Making your Custom Entity worldDraw or viewportDraw fast
by Fenton Webb Issue My Custom Entity is rather complex, whenever my users call the Rotate or Move command or basically do something which requires continual updating of the graphics it becomes very jerky and slow. How can I improve this? Solution All of the Graphics Primitive functions housed ...
Hey Craig!
the problem with being efficient is that it usually exposes you to the lower level parts of the API. The .NET API wraps the ObjectARX API, and that low level exposure is bringing up ObjectARX class names such as AcDbBlockReference.
You can use the RXClass object to extract the ObjectARX class name of a .NET equivalent so that you bypass this problem - e.g. something like:
RXClass blockRefRX = RXClass.GetClass(typeof(BlockReference));
Obtaining the Class type from an ObjectId (not having to open for read)
by Fenton Webb I’m sure you have all seen code like this before, where you open an entity in the DWG database to find out its type… Database db = Application.DocumentManager.MdiActiveDocument.Database; using (Transaction trans = db.TransactionManager.StartTransaction()) { // open the entities...
this is better
http://adndevblog.typepad.com/autocad/2013/04/autoloader-example-for-invoking-a-startup-command-in-autocad.html
Modify Ribbon
By Adam Nagy I would like to modify the Ribbon content - add/remove panels, etc. How could I do it? Solution This is only available through the .NET API's. There are two sets of functionalities: 1) Ribbon Runtime API - provided by AdWindows.dll under Autodesk.Windows namespace Enables you to edi...
removing the less than and greater than signs (sigh)
Components Description="Any CPU DLLs"
RuntimeRequirements OS="Win32|Win64" Platform="AutoCAD|AutoCAD*" SeriesMin="R19.0" SeriesMax="R19.0" /
ComponentEntry AppName="MyDotNetApp" Version="1.0.0" ModuleName="./Contents/Windows/R19.0/MyApp.dll"
Commands
Command Local="_MyAppStartupCmd" Global="MyAppStartupCmd" StartupCommand="True" /
/Commands
/ComponentEntry
Modify Ribbon
By Adam Nagy I would like to modify the Ribbon content - add/remove panels, etc. How could I do it? Solution This is only available through the .NET API's. There are two sets of functionalities: 1) Ribbon Runtime API - provided by AdWindows.dll under Autodesk.Windows namespace Enables you to edi...
Hey BlackBox,
you should not modify the Ribbon from initialize()... that function is called too early in the startup if called to load on startup.
Best is to use the StartupCommand attribute on the Command element... This will call your own initialize command when AutoCAD has fully initialized. e.g.
Modify Ribbon
By Adam Nagy I would like to modify the Ribbon content - add/remove panels, etc. How could I do it? Solution This is only available through the .NET API's. There are two sets of functionalities: 1) Ribbon Runtime API - provided by AdWindows.dll under Autodesk.Windows namespace Enables you to edi...
OK, got ya.
There's always a Model Space selection filter remember...
http://exchange.autodesk.com/autocadarchitecture/enu/online-help/ARCHDESK/2012/ENU/pages/WS1a9193826455f5ff2566ffd511ff6f8c7ca-4067.htm
Type comparison optimization in .NET
By Augusto Goncalves Although this is not AutoCAD or Autodesk related, I always see developers doing .NET code that can be optimized. Sure in some cases this is not a concern, or the processing time that will be saved doesn’t worth the trouble. But doing some small good practices can save you bi...
Hey Tony!
appreciate your reply. The thing is, if it's an object in AutoCAD, you normally use ObjectID or Handle to compare if they are the "same object" you see... You can't rely on the memory address, because sometimes the memory manager moves the object, that's one of the reasons why we have an transaction/open close mechanism.
Type comparison optimization in .NET
By Augusto Goncalves Although this is not AutoCAD or Autodesk related, I always see developers doing .NET code that can be optimized. Sure in some cases this is not a concern, or the processing time that will be saved doesn’t worth the trouble. But doing some small good practices can save you bi...
Hey Tony!
it's long thread here, so let me ask you - are we talking about simple object comparison now? if not, please ignore this post, if so...
...then you are right, if( a.UnmanagedObject == b.UnmanagedObject) {...} **is** much faster.
However, what is the comparison you are trying to do exactly? You are comparing 2 memory addresses as being the same - Yes, it's the same physical object - but what does that achieve? More likely is that you want to compare the data between 2 objects as being the same, not the address that they reside in memory.
Generally speaking, the Equals operator compares if the 2 objects have the same data, not that they are the same address in memory, testing the UnmanagedObject is of no use. I haven't checked the details of the boxing/unboxing that you talk about but it's probably related to the .NET property handling.
Correct, how the equals operator works is down to the implementer.
Type comparison optimization in .NET
By Augusto Goncalves Although this is not AutoCAD or Autodesk related, I always see developers doing .NET code that can be optimized. Sure in some cases this is not a concern, or the processing time that will be saved doesn’t worth the trouble. But doing some small good practices can save you bi...
it's in the inc folder of the ObjectARX SDK.
Creating a Mixed Mode RealDWG Application
by Fenton Webb If you are a seasoned RealDWG developer, you will have probably noticed that the .NET version of the RealDWG SDK’s HostApplicationServices object does not implement all of the virtual functions that are exposed by its unmanaged ObjectDBX counterpart, AcDbHostApplicationServices. F...
Hi Loic
no problem. One last thing, if you use DrawJigs, then the same rule applies. If you use AcEdJig, then you should check inputPending() for long iterations in your code - otherwise it's handled by AutoCAD automatically.
Making your Custom Entity worldDraw or viewportDraw fast
by Fenton Webb Issue My Custom Entity is rather complex, whenever my users call the Rotate or Move command or basically do something which requires continual updating of the graphics it becomes very jerky and slow. How can I improve this? Solution All of the Graphics Primitive functions housed ...
Hi Mono
you don't add vbLf to a typedvalue string, you create new typed values... e.g
rb.Add(New TypedValue(5005, "_.AECTOACAD");
rb.Add(New TypedValue(5005, "_bind");
rb.Add(New TypedValue(5005, "_no");
rb.Add(New TypedValue(5005, AecToAcadFileName);
acedCmd(rb.UnmanagedObject);
Synchronously Send (and wait for) commands in AutoCAD using C# .NET
By Fenton Webb I’m really sorry to say, but anyone who tells me that acedCommand() and acedCmd() are not good C++ functions for driving AutoCAD, are crazy! These functions have existed since the original R11 ADS development system in C and have always been used to synchronously send commands to ...
Hi Loic
yes, it's true!!
You can also check inputPending() for AutoCAD side user interaction checking.
Making your Custom Entity worldDraw or viewportDraw fast
by Fenton Webb Issue My Custom Entity is rather complex, whenever my users call the Rotate or Move command or basically do something which requires continual updating of the graphics it becomes very jerky and slow. How can I improve this? Solution All of the Graphics Primitive functions housed ...
AutoCAD 2014's Incredible Easter Egg Surprise
Posted Apr 1, 2013 at AutoCAD DevBlog
Comment
8
Hey Spider
there is a lack of documentation because the design is not yet finalized. Also, as you mention, there is no schema as yet, the idea being to allow developers to utilize the same XML package for their own App settings.
Finally, you should check out this link http://adndevblog.typepad.com/autocad/2013/01/autodesk-autoloader-white-paper.html
AutoLoader 101: #1 – A Simple Working Sample
AutoCAD has provided so called AutoLoader for a while. It is announced to be environment friendly (no need to mess up the Windows Registry anymore), support multiple versions, support both AutoCAD and its flavors (such as AutoCAD Mechanical and AutoCAD Architecture) at the same time in a single ...
More...
Subscribe to Fenton Webb’s Recent Activity