This is Spiderinnet1's Typepad Profile.
Join Typepad and start following Spiderinnet1's activity
Join Now!
Already a member? Sign In
Spiderinnet1
a spider crawling mainly in the .NET of AutoCAD
Interests: It is a spider crawling mainly in the .NET of AutoCAD. Sometimes, it may crawl a little deeper down into the Microsoft .NET world as well to find something good and fast there to digest.
Recent Activity
Ben, the code and any other AutoCAD .NET have to run inside AutoCAD. The limitation is imposed by AutoCAD itself. That is it!
BKSpurgeon, the PushModelTransform() has a matrix parameter as can be seen. After the call, all graphics in the WorldDraw will be transformed by the matrix until the PopModelTransform() is called. In this case, the graphics were transformed from the UCS to WCS since points were collected and expressed in UCS.
BKSpurgeon, or another word may make it clearer. It's the least code that still creates a functional line jig. If we want to add more features, we need to implement more methods and/or add more code, e.g. adding more prompts, changing color, adding dynamic dimension, etc. Many other posts have demonstrated such.
BKSpurgeon, a good question. RXClass is a basic stuff and more ARX than .NET. It may provide some useful information such as DXFName and AppName. In fact, if you read the ARX documentation, you will notice a few RXClass related stuffs such as AcRxDictionary and some macros. You can simply iterate through the whole ARX class tree and their protocol extensions using them. However, the class has not been exposed to the .NET API and likely will not. But still we can use the RXClass to make our coding life a bit easier and improve the app performance if necessary. Here are a couple of posts demonstrating these. http://spiderinnet1.typepad.com/blog/2012/10/autocad-net-find-objects-from-database-concisely-reliably-and-quickly.html http://spiderinnet1.typepad.com/blog/2012/04/various-ways-to-check-object-types-in-autocad-net.html
BKSpurgeon, you are right. Confusions are here and there about fields and different properties. Discerning them might not be so easy or necessary but aware of when to use which are. For example, properties support (de)serializations but fields not; INotifyPropertyChanged implemented full properties support two-way WPF data bindings; Auto-Properties are easy to define but less flexible. In terms of those ENCAPSULATION, MVVM or similar big concepts, we can leave them to language lovers.
Dear Gclaurev, thanks for the further information. AutoCAD MEP has its own .NET API and the API documentation should be along with the product documentation.
Dear Gclaurev, I am afraid that you have stepped into a dilemma situation. As you may have already found out, LISP is easy to use but hard to control everything; the .NET API is a bit hard to learn but it is very powerful. By the way, the ObjectId is really an ARX or .NET thing and Auto/VisualLISP knows nothing about it.
Dario, you can simply remove the original block insert, create a new insert from the same block definition, and use it as the jigging target. Another post may give you some idea about it: http://spiderinnet1.typepad.com/blog/2012/02/autocad-net-entityjig-honor-ucs-when-inserting-block-insertblockreference.html
Recently a reader contacted us for ideas about some code (named as DirectionalLeaderJig) posted somewhere on web with the following title: Jigging an AutoCAD leader with directional text using .NET Through reading the article and trying the code, we found it would cause more Mis-Leading rather than give right directions.... Continue reading
Posted Jan 12, 2017 at AcadNetAddinWizard & More
Ben, almost. Both model and paper space layouts have the IsLayout as true, so !btRecord.IsLayout will return all real block definitions (block table records) in the current database. Layouts correspond to all those layout tabs under the drawing area. They are drawing containers but AutoCAD uses the same block concept for them, from the API perspective.
Ben, if you run the code in a viewport, you will notice the resulting yellow rectangle will always parallel to the viewport boundary no matter how the WCS is rotated or twisted inside the viewport. If you read the previous post and some after, the DCS concept will be clearer.
Ben, you are right. Any points you create will be expressed in WCS. If you'd like to draw them onto the current UCS, the inversion of the Editor.CurrentUserCoordinateSystem can be used to transform them.
Ben, it's really a good question. The Editor.GetPoint() method always returns a point in UCS. The Editor.CurrentUserCoordinateSystem has the transform matrix from the current UCS to WCS. If the picked point has to participate into some geometry creation or calculation, it has to be transformed from its UCS to WCS since all AutoCAD geometry information is stored in WCS.
BKSpurgeon, glad you like it. You are welcome.
Hi Ben, the DynamicDimensionDataCollection class is used to collect the dimension data for the jig graphics. If the dimension is not necessary, the class and its instances can all be removed of course from the code. The virtual method GetDynamicDimensionData() does not have to be overridden as demonstrated here. You can simply ignore it.
It's good to read the ARX documentation to help understand AutoCAD .NET concepts and classes since the .NET API is nothing more than an ARX wrapper, as you may have figured. In terms of the WorldGeometry class, it can be thought as a help class, which can help draw geometries such as the polygon here and do transformations if necessary into the graphing engine such as the WorldDraw that is passed into the jigger by AutoCAD.
BKSpurgeon, they are called by the AutoCAD internal jigging system. That's why the jigger needs to be registered through the following call: Editor.Drag(jigger);
BKSpurgeon, glad you like it. In terms of getting the current dimension, the Database.Dimstyle looks what you are looking for. A small tip: current setting objects mostly could be found from the active or current Database. Cheers.
Dear BKSpurgeon, we would say no particular reason. The jigger variable can be local and put into the command method in this case, as you suggested.
Rathlo, glad you like it. Happy coding with AutoCAD .NET.
public static RibbonPanelSource GetRibbonPanel(CustomizationSection cs, string panelName) { System.Collections.ObjectModel.Collection csList = new System.Collections.ObjectModel.Collection(); csList.Add(cs); return RibbonRoot.FindPanelSource(csList, cs.MenuGroup.Name, panelName + "_PanelSourceID"); }
Daniel, thanks a lot. Yes, it's simpler and more flexible.
Many times, we need to stack some controls such as group boxes, list boxes and data grids into a WPF grid. If the last control is a DataGrid for example, odd behavior may just occur. If the data list is too long in the DataGrid, it may right extend outside... Continue reading
Posted Aug 29, 2016 at AcadNetAddinWizard & More
When a big visual studio solution adds or switches projects, many times, a Mixed Platform Visual Studio Project Configuration will be automatically created and SET AS THE ACTIVE CONFIGURATION. Not sure how that happens exactly, but unfortunately it will cause very weird behavior and waste a lot of time if... Continue reading
Posted Aug 5, 2016 at AcadNetAddinWizard & More