Guidelines for Programmer v1

download Guidelines for Programmer v1

of 3

Transcript of Guidelines for Programmer v1

  • 7/24/2019 Guidelines for Programmer v1

    1/3Page | 1

    AutoCAD customizationI am looking for custom AutoCAD commands that will do what I have described further.

    Starting Point1. The attached dwg is an example of a typical dwg file I work with. Please read this document while referring to

    the dwg in AutoCAD simultaneously.

    2.

    The dwg has the following layers. Each layer contains one or more closed polylines, except the layer withWNin the layer-name, which only has open polylines (single line with global width).

    3. The layer names will always follow the format (1 to 20 characters)_(2 characters). The part before the

    underscore will be different in different dwg files. For example, the layer F01_FLcould be F03_FLor

    Second_FLin another dwg. However, this part before the underscore will be the same for all layers in each

    dwg. Please ask questions to make sure that you understand this.

    What I am asking forI need some custom AutoCAD commands that I have described as follows:

    Command 1: Alias DRF1(DrawRoomFloor1)Step1.dwg represents the typical dwg state before I use the custom commandDRF1. So, once I enter commandDRF1, it should execute the following tasks, in that order.

    1. Turn off all layers except layer 0. Turn on layer with RMin its layername (henceforth called RMlayer), and

    make it current.

    2. In this RMlayer, auto-insert a polyline into each enclosed space (meaning, space enclosed by lines in layer

    0), similar to how the BOUNDARYcommand can be used to create polylines. However, unlike the

    BOUNDARY command, any polyline created should have a vertex at each point where another line meets it. For

    example, as shown in the following figure, the polyline for the enclosed blue space should not only have vertices

    at points A, B, C and D, but also at point E because a line meets side DA at point E. Hence side DA gets split as

    sides DE and EA. Please ask questions if this is unclear.

  • 7/24/2019 Guidelines for Programmer v1

    2/3

    Page | 2

    3. Also, as seen in the figure, polylines must always have their vertices (vertex 1, vertex 2so on) going in anti-

    clockwise direction. If I use the BOUNDARYcommand, AutoCAD creates a polyline exactly like that (anti-

    clockwise). But if you write another method in your code, please ensure that this condition is met.

    4.

    Alright, so by now, we should see polylines in theRMlayer, which cover each of the enclosed spaces in layer

    0. Part 1 of command this completed.

    5.

    In Part 2, turn off the layer 0. Turn on the layer with FLin its name (henceforth called FLlayer), and make it

    current.

    6.

    In this FLlayer, auto-create a polyline that encloses all the polylines in the layer withRMin its name. This

    polyline should also pick up intermediate vertices just like the RMpolylines.7. Please refer to Step2.dwg, layers F01_RMand F01_FLto better understand what is expected from the

    custom command DFR1. Please ask questions to clarify your doubts.

    Command 2: Alias CBL2(CreateBlocks2)1.

    Turn on all layers.

    2.

    Convert each polyline into an individual block. Each block should get created in the parent layer of the original

    object. Only the blocks should remain in the dwg, not the original objects, because the command should use

    Convert to block, and not Retain or Delete.The X, Y & Z coordinates of a block should always be 0 (zero).

    3. For each block, the block name should be in the format: LayerName_Counter. For blocks within each layer, the

    counter goes from 1 to the number of blocks in that layer. Example of block name in layerF01_RM:

    F01_RM_18.4. Blocks in each layer should have the following editable attributes assigned to them:

    Layer name

    ending with

    Blocks will get the following attributes based on their parent layer name. Default value of each

    attribute should be pre-filled. I will edit these manually.

    CA Attribute name: CAatt1 CAatt2 CAatt3 CAatt4 CAatt5

    Default value: @@ @@ @@ @@ @@

    FL Attribute name: FLatt1 FLatt2 FLatt3 FLatt4 FLatt5

    Default value: @@ @@ @@ @@ @@

    RF Attribute name: RFatt1 RFatt2 RFatt3 RFatt4 RFatt5

    Default value: @@ @@ @@ @@ @@

    RM Attribute name: RMid RMcount RMatt3 RMatt4 RMatt5Default value: RM 1* @@ @@ @@

    SK Attribute name: SKtype SKatt2 SKatt3 SKatt4 SKatt5

    Default value: S 1 @@ @@ @@ @@

    WN Attribute name: WNtype WNatt2 WNatt3 WNatt4 WNatt5

    Default value: W 1 @@ @@ @@ @@

    * This attribute, RMcount, should be the same number as the number in the block name (Refer Command 2, point

    3 above).

    5.

    Please write the code in a way that it is easy for me to edit the attribute names and their default values.

    6.

    There might be times when I have already run this commandCBL2, and the blocks have been created with

    their respective attributes, and then I manually add one or more polylines in some layers. Re-running theCBL2

    command at this time should only affect the newly created polylines, and they should get converted into new

    blocks, with attributes depending on which layer the blocks are in.

    Command: Alias ES3(ExportStuff3)1. This command should export (in .csv format) the following information about each of the blocks in all layers.

  • 7/24/2019 Guidelines for Programmer v1

    3/3

    Page | 3

    "F01_FL_1"