Transformed BlockReferences (AutoCAD .net API)

So you’ve inserted a block reference into the model space. Very good. And you’ve decided to rotate it and move it around. Again: very good. Now you wish to programmatically place more block references, similarly rotated, but perhaps spaced some distance apart. How are you going to do this.

Read More

Finding a duck type (OOP)

I see this problem all too often in stack overflow: a situation where folks check for the type of a class in an if statement, and then respond accordingly. Rather than repeating myself a million times, I thought it much easier just to write a post on the subject (DRY FTW!). Anyways, this type of code (pun intended) smacks of a duck type not being identified and utilised.

Read More

Liskov Substitution Violations (OOP)

Imagine you have two classes. A parent and a child class. The child inheritance from the parent. Therefore the child should be able to do everything that a parent does and possibly more.

Read More