Excel xyz points to profile view staoff labels- modifiy to add blocks

Install “ArkanceSystems” by @Anton_Huizinga. You will also find several other useful nodes in that package.

1 Like

Thanks Shaun

1 Like

Hi Shaun,

This is wonderful…I finally got it working. I still need to add all the input types, but it’s working.
I’ve got a few questions about the creation of the profile inserted blocks and the layers with color. I guess I don’t see where, or understand how the blocks are made and how the colors are set. I want to make sure I understand that section so I can make changes to block types and colors for future use. also, with a better understanding of the mleader module I think I could make a few more mleader labeling tools.
Shaun, Thank you for all your help. this was a great learning experience.
John
points to profile-shaun-v2.xlsx (17.0 KB)
EXCEL XYZ-POINTS TO PROFILES-shawn-v2.dyn (149.3 KB)
points to profile-shaun-v2.dwg (1.7 MB)

1 Like

Hey John, happy it helps. The script currently uses the “desc” value in the table to chose what block is placed. The blockname in the blockrecord of the drawing I provided intentionally matches this value. If you want, you can add a column to your excel file with the header “blockName”. Then you would add another “Dictionary.ValueAtKey” node and string node with the text “blockName” in it. (You can repeat this for any columns you want to take out of the excel file) Then you can put the name of the blocks you want placed in that column of the excel file and feed that into the Block.Reference.CreateBlockReference.

You can do the same by adding a “layerIndex” column to excel to set the color. You could even create “layerIndexBlocks” and “layerIndexAnnotations” columns such that you can control the color of the layers created for the annotations and the blocks via the excel file. I am attaching an example to this post with images since you’re having trouble opening the .dyn file.

Note, in order to create these block references in the drawing, the blocks would have to already exist, in the drawing’s blocktable, in which the script is ran. If you want to run the script on a drawing but don’t already have all the blocks imported, but you have a drawing that contains the blocks, you can use Block.Import (see photos).

I think these changes will give you more control and should work better.

Blocks.dwg (941.4 KB)
EXCEL XYZ-POINTS TO PROFILES-shawn-v2.dyn (219.0 KB)
points to profile-shaun-v3.dwg (1.8 MB)
points to profile-shaun-v3.xlsx (16.7 KB)


Hope this helps,

Shaun

p.s. make sure you have arkance and camber installed.

1 Like

Shaun,

Thanks, this is good stuff. right after I sent the last reply I thought …I bet the blocks were already in the drawing. I’ll try working out some of your suggestions.

Thank you
John

1 Like

If you use the Arkance Systems node CreateBlockReference, the blocks don’t need to be inserted yet in the drawing. If they are not available, the node looks in the Resources folder:

You set the location to that folder in the Settings dialog (via menu Packages):

If the block is found there, it will auto insert it for you.

1 Like

This would be a great change to simplify things. Once camber is updated next I would also replace the Mleader.ByObjectPoint node with it’s mleader node so you don’t have to make a pointless circle entity in autoCAD at (0,0).