This is Spiderinnet1's Typepad Profile.
Join Typepad and start following Spiderinnet1's activity
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
Revit SPF Organizer 2022 was released. It supports all new parameter types and categories of Revit 2022, 2021 and 2020!
Revit SPF Organizer 2022 has been released. Now it... Continue reading
Posted Apr 22, 2022 at AcadNetAddinWizard & More
Comment
0
Revit|AutoCAD|Inventor|Navisworks .NET Addin Wizards 2017 have been released!
Revit|AutoCAD|Inventor|Navisworks .NET Addin Wizards 2017 have been released! They support Visual Studio 2017 now. They support the latest three versions (2019, 2018 and 2017) along with many old ones of related products, flavors and verticals of Revit|AutoCAD|Inventor|Navisworks. Many features have also been enhanced to adopt to the new versions and... Continue reading
Posted Aug 20, 2018 at AcadNetAddinWizard & More
Comment
0
chrs, you are welcome. It transforms the circle center coordinate from the World system to the Eye system. The Viewport.EyeToWorldTransform returns a matrix from the Eye CS (on the computer screen) to the WCS in which all AutoCAD entity geometries are expressed, thus the Center.TransformBy methods accepts its Inverse copy.
AutoCAD Overrule .NET: Centerline Circle – ViewportDraw
AutoCAD has provided the Overrule .NET API in recent versions. It is the most powerful .NET API so far and can provide almost the custom entity feature that is still only available in the most powerful AutoCAD API, ObjectARX. On the other hand, however, the Overrule API is also the most complex ...
AutoCAD .NET Addin Wizards 2015 Has Been Updated!
AutoCAD .NET Addin Wizards 2015 Has Been Updated! The latest build supports the latest three versions (2019, 2018 and 2017) of AutoCAD and most of its verticals besides all those already supported old versions such as 2016, 2015, 2014, 2013, 2012, 2011 and 2010. Many features have also been enhanced.... Continue reading
Posted Jul 17, 2018 at AcadNetAddinWizard & More
Comment
0
You are right!
AutoCAD .NET: Vector Direction, Tolerance and Equality Checking
Recently looked at some tolerance stuffs in AutoCAD .NET and noticed a pretty interesting thing. That is, sometimes two totally opposite vectors such as positive direction along the X axis and negative direction along the same X axis can be equal! Here is the code to prove it. [CommandMethod("Ve...
Ben, glad you did so. The post looks good and reads clear. (y)
AutoCAD .NET: Vector Direction, Tolerance and Equality Checking
Recently looked at some tolerance stuffs in AutoCAD .NET and noticed a pretty interesting thing. That is, sometimes two totally opposite vectors such as positive direction along the X axis and negative direction along the same X axis can be equal! Here is the code to prove it. [CommandMethod("Ve...
It is interesting for sure. Not sure if they return the same hashcodes. Please give it a try and write a post. :-)
AutoCAD .NET: Vector Direction, Tolerance and Equality Checking
Recently looked at some tolerance stuffs in AutoCAD .NET and noticed a pretty interesting thing. That is, sometimes two totally opposite vectors such as positive direction along the X axis and negative direction along the same X axis can be equal! Here is the code to prove it. [CommandMethod("Ve...
Ben, glad to know it works fine now.
AutoCAD .NET: Iterate Through Text Style Symbol Table
We need to iterate through the text style symbol table of the current database from time to time. Here is some succinct and good code in C# to do so. [CommandMethod("TextStyleIterator")] public static void TextStyleIterator_Method() { Database database = Host...
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.
AutoCAD .NET: Iterate Through Text Style Symbol Table
We need to iterate through the text style symbol table of the current database from time to time. Here is some succinct and good code in C# to do so. [CommandMethod("TextStyleIterator")] public static void TextStyleIterator_Method() { Database database = Host...
Jon, you are welcome. It is achievable with some challenging. Having fun.
AutoCAD Jig & VB.NET: EntityJig – Mouse Wheel Up/Down as Rotation Increment/Decrement During Block/Insert Rotating
AutoCAD .NET API provides two concrete Jig classes for us to jig different entities in different circumstances, EntityJig and DrawJig. EntityJig is to jig a specific entity as its name indicates and the DrawJig is to jig anything that has graphics to draw, which can be a single entity, a group o...
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.
AutoCAD Jig & VB.NET: EntityJig – Mouse Wheel Up/Down as Rotation Increment/Decrement During Block/Insert Rotating
AutoCAD .NET API provides two concrete Jig classes for us to jig different entities in different circumstances, EntityJig and DrawJig. EntityJig is to jig a specific entity as its name indicates and the DrawJig is to jig anything that has graphics to draw, which can be a single entity, a group o...
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.
AutoCAD Jig & VB.NET: EntityJig – Mouse Wheel Up/Down as Rotation Increment/Decrement During Block/Insert Rotating
AutoCAD .NET API provides two concrete Jig classes for us to jig different entities in different circumstances, EntityJig and DrawJig. EntityJig is to jig a specific entity as its name indicates and the DrawJig is to jig anything that has graphics to draw, which can be a single entity, a group o...
A few other posts on this blog introduce how to jig cylinders, cones and so on. Here is one:
http://spiderinnet1.typepad.com/blog/2012/12/autocad-net-using-entityjig-to-create-solid-frustum-dynamically.html
AutoCAD .NET: EntityJig – Jig Line by Start and End Points
AutoCAD .NET API provides two concrete Jig classes for us to jig different entities in different circumstances, EntityJig and DrawJig. EntityJig is primarily used to jig a specific entity as its name indicates and the DrawJig is to jig anything that has graphics to draw, which can be a single en...
Ben, the code and any other AutoCAD .NET have to run inside AutoCAD. The limitation is imposed by AutoCAD itself. That is it!
AutoCAD .NET: Read DWG Into Memory Using Database.ReadDwgFile
In the past C++/C era, it was very easy to crash AutoCAD or even the whole Operating System. Now in the .NET time, it is harder, much harder than before, but we still can find various ways to crash AutoCAD using its .NET API, from the easiest or most common to quite hard or very creative. Many t...
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.
AutoCAD .NET: DrawJig Poly Lines
AutoCAD .NET API provides two concrete Jig classes for us to jig different things in different circumstances, EntityJig and DrawJig. EntityJig is to jig a specific entity as its name indicates and the DrawJig is to jig anything that has graphics to draw, which can be a single entity, a group of ...
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.
AutoCAD .NET: The Simplest but Still Quite Functional Line Jig from DrawJig
AutoCAD .NET API provides two concrete Jig classes for us to jig different graphics in different circumstances, EntityJig and DrawJig. EntityJig is generally used to jig a specific entity as its name indicates and the DrawJig is to jig anything that has graphics to draw, which can be a single en...
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
What RXClass Can Give Us in AutoCAD .NET
In this post, let us look at the RXClass in a bit detail and see what it can give us when programming with AutoCAD .NET. Then we may find good use of it in the future. Here is the test command and code to inspect at the RXClass for the Circle class: [CommandMethod("RxClassInfo")] public static ...
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.
What is the difference between a Field and a Property in C#?
People may wonder whether we are going to really talk about this. No, we are not. That is not the focus of our posts or blogs. In addition, MSDN and C# specifications generally provide very useful and official information about it. In fact, it's a QA on the StackOverflow, which we stepped into r...
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.
AutoCAD .NET: Iterate Through Model Space
We need to iterate through the model space of the current database from time to time. Here is some succinct and good code in C# to do so. [CommandMethod("ModelSpaceIterator")] public static void ModelSpaceIterator_Method() { Database database = HostApplicationServices.WorkingDatabase; us...
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.
AutoCAD .NET: Iterate Through Model Space
We need to iterate through the model space of the current database from time to time. Here is some succinct and good code in C# to do so. [CommandMethod("ModelSpaceIterator")] public static void ModelSpaceIterator_Method() { Database database = HostApplicationServices.WorkingDatabase; us...
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
AutoCAD Jig & VB.NET: Move Block/BlockReference/INSERT Using EntityJig
AutoCAD .NET API provides two concrete Jig classes for us to jig different entities in different circumstances, EntityJig and DrawJig. EntityJig is to jig a specific entity as its name indicates and the DrawJig is to jig anything that has graphics to draw, which can be a single entity, a group o...
AutoCAD .NET: MultiLeader (MLeader) and EntityJig
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
Comment
0
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.
AutoCAD .NET: Iterate Through All Blocks Excluding Model and Paper Space
We need to iterate through all the blocks of the current database with some conditions such as not wanting model space and paper space from time to time. Here is some succinct and good code in C# to do so. [CommandMethod("BlockIterator")] public static void BlockIterator_Method() { Database ...
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.
AutoCAD .NET: Matrix & Transformations – DCS vs. WCS
As talked a little bit previously, there is a simple but serious bug in the VBA macro fViewExtents as posted somewhere on the web. The previous posts were not focused on the bug at all. Instead, they introduced a quick and reliable approach of porting existing VBA code to VB.NET. In this post, w...
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.
AutoCAD .NET: Transform Picked Point from Current UCS to WCS
We are addressing a very simple task regarding AutoCAD .NET programming in this article. How to transform a picked point from the current (active) UCS to the WCS? It sounds too obvious to metion. That was also what we thought about it, and it explains why the topic was not covered explicitly be...
More...
Subscribe to Spiderinnet1’s Recent Activity