Author: admin

  • What does GroupBy do – Simple Explanation (Linq)

    What is GroupBy meant to do – Simple Explanation

    As always we will try to formulate a simple explanation of what is really going on.

    Airport

    Imagine you are at an airport and (as always) there is a queue and planes are delayed. See below. What you will immediately notice is that all of the passengers are grouped together promiscuously – standing around in slumps in no particular order. Every body is mixed up with each other.

    But, when you get into the plane, everybody is grouped into three distinct orders:

    1. First class
    2. Business class
    3. Third class. These classes are defined today by folks’ ability to pay. Unlike the olden days. Anyways, let’s move on.

    That’s basically what group by does. It takes a promiscuous group and separates them into distinct orders – in this case, three distinct groups of people: first, business and third class.

    So now you can say:

    • Get me all the names of all the people in first class.
    • Get me the names of all the people in the middle class who live in Europe.

    And it’s as simple as that! As for the technicalities: please refer to the MSDN documentation – hopefully reading it won’t cause too much discomfort.

  • Rules for shop welding Elbows to Stair balustrades

    Shop Welding Elbows.

    If the pipe is going up then do not weld the elbow to the pipe. Leave extra length on the pipe. Fabricator will cut at site and weld. (Make it slip joint)

    If the pipe is horizontal then you can weld at one end.

    See images

     

    RULES-FOR-SHOP-WELDING-ELBOW
    WELDING ELBOWS TO RAILINGS
    PIPES WITH EXTRA LENGTH AT ELBOW
    EXTENDING PIPES TO SUIT AT SITE

    RULES-FOR-SHOP-WELDING-ELBOW-2

  • Why Bubble Deck?

    Bubble Deck – What’s so good about it?

    BubbleDeck
    BubbleDeck
    1. It’s fast, really fast.

    If you can build something quicker, than translates into making money quicker. There’s a premium on speed.

    1. Less manpower

    Less manpower on site. That means less potential problems to deal with. Which eventually translates into money. Generally speaking, the problems and costs associated with a project are proportional to the number of people involved in it.

    1. Structural Benefits

    Bubble deck slabs, because they are filled with air, are significantly lighter. Also you can have wider spans – without as much column support. This is very desirable from an architect’s point of view.

    1. Cost of manufacturing

    The BubbleDeckGroup tout it as being cheaper to manufacture. Personally, I’m sceptical of this claim. I think it’s the same, if not more.

    1. Environmentally Friendly?

    They also say it’s more environmentally friendly. It probably is relative to other solutions, but I don’t think it’s actually helping the environment. It’s sort of like the marketing on a cigarette packet saying that it’s “healthier” than other cigarettes. It is probably healthier, but cigarettes as a whole, generally speaking are not healthy. 

    What are the costs?

    Everything has to be designed correctly and properly early on. This is not necessarily a bad thing. It forces designers to plan and think things out, before the actual construction. But if the design team does a bad job, you can be sure that the entire project is going to be delayed, and is going to be monumentally expensive.

  • c# .Net Autocad plugin – “Hello world” Walk through

    There’s not much out there in the way of introductions. You’d have to wade through some manuals and it can be tedious. A simple walk through of how to get started. You would do well to record it at 1.5-x2 playback speed.

     

    Autocad .net c# Plug in – Hello World Example from Tek1 on Vimeo.

  • Checking the type of an Entity? (AutoCAD .net)

    Ok, so you’ve got a bunch of entities in a collection. You only want to deal with circles. You need to iterate through the collection and consider only the circles. But how will you identify the circles from the other objects.

     

    1. Casting.

    You can cast

    Entity en = en as Circle

    And then you can test whether entity is null.

    If (en == null )

    { // throw new Exception etc. etc. }

     

    Or you can try the equivalent:

    If (en is Circle)

    { // Perform operation etc. etc.}

     

    What is the catch with this approach?

    • The benefits are that it is really quick and dirty.
    • ………most important that you gotta watch out for is that it tests for Circles and subsequent sub classes of circles. You may not want that so watch out!

     

    1. GetType

    I’ve also seen folks on the forums use the Gettype to  check for the type of the entity. It goes something like this:

    en.GetType() == typeOf(Circle)

     

    The Catch with this approach

    • It’s painful to read.
    • Two computations involved, just like the first approach. I can’t see the performance being too much better or worse.

     

    Another approach is to use Dxf codes to check for the name. But this is overcomplicated. I don’t see many people using it on the forums and you need the object ID of the relevant entity and all the overhead associated with it.

    In my opinion, keep it simple. Casting, after all things considered, is probably the best option, but you have to watch out – all subclasses will return true. So you need to use the most granular class you can if that is at all important.

  • Get SelectionFilter by block Name

    It is very common that you will need to create selection filters for different types of blocks. Why repeat yourself?

     

    There is a very simple utility that I wrote that is amazingly handy for solving this very issue. Best part is that it accepts wildcards, so you can search for block references which, for example, start with Fire by passing in “FIRE*” as the argument:

    public static SelectionFilter GetSSFilterBlockReferenceByName(string name)
    {
    TypedValue[] filterlist = new TypedValue[2];
    filterlist[0] = new TypedValue(0, “INSERT”);
    filterlist[1] = new TypedValue(2, name);
    SelectionFilter filter = new SelectionFilter(filterlist);
    return filter;
    }

    So simple!

  • Convert ObjectID[] to ObjectIDCollections!

    When dealing with selection sets we can obtain the object ids of the objects contained within. The method though, returns an array.

     

    But what if we want an ObjectIDCollection?

     

    We can simply pass the ObjectID[] array into the ObjectIDCollection constructor.

     

    Simple. The last thing you want to do is iterate through the array and add it to a collection individually. A simple yet handy hint which can save you a lot of effort.

  • Tek1 Now Drawing Bubble Deck!

    Tek1 – Now has Bubble Deck Capabilities

    Bubble Deck

    After sending our staff overseas for an intensive Bubble Deck training camp, and after the development and preparation of tools to handle Bubble Deck detailing, Tek1 is pleased to announce that in addition to stand panel detailing, Tek1 has started to draw Bubble Deck slabs.

    This has been the culmination of months of hard work.

     

    What is bubble Deck?

    • It is basically a concrete slabbed, reinforced, with voids in it. It is perhaps best illustrated with pictures:

     

    Bubble Deck Slabs
    Bubble Deck Slabs

     

    Cross section of bubble deck slab
    Cross section of bubble deck slab