This is Spiderinnet1's Typepad Profile.
Join Typepad and start following Spiderinnet1's activity
Join Now!
Already a member? Sign In
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, glad you did so. The post looks good and reads clear. (y)
It is interesting for sure. Not sure if they return the same hashcodes. Please give it a try and write a post. :-)
Ben, glad to know it works fine now.
Hi BKSpurgeon, it might be the DWG you tried the code with was too new. By default, new drawings only have the two text styles as mentioned. The DWG we tried on our end was a bit old and complex.
Jon, you are welcome. It is achievable with some challenging. Having fun.
The request does makes sense, but the current AutoCAD .NET Jig system does not provide direct way to do that. The current Jig system takes care of variables (Location and Rotation here) step by step, as demonstrated in many posts, instead of all at the same time. You may have already got some impression about it. At this moment, an idea is to care the Rotation normally in the Jig class, detect the cursor position and transform it into AutoCAD WCS somewhere else (e.g. in a timer), and change the Position there accordingly.
Jon, glad you like the posts and the blog. In terms of rotating block first and moving next, it is possible. The key point is that a temporary insertion point is needed for the block to rotate around. You may want to use the center point of the screen for that purpose so that the rotating block can be seen on the screen. Some other posts on the blog introduce WCS/UCS/DCS/ECS points and their transformations.
A few other posts on this blog introduce how to jig cylinders, cones and so on. Here is one:
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.
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:
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.