Jump to content

Batch Block Insertor


Lee Mac

Recommended Posts

I realise that this is quite a simple program as coding goes, but it has been requested more times than I can remember, so I thought I'd try to write a half decent one. :P

 

So here goes...

 

All instructions are in the header, will read txt or csv :)

 

;;;¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,;;;
;;;ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,¤º°`°º¤;;;
;;                                                                               ;;
;;                                                                               ;;
;;                          --=={  Block Insertor  }==--                         ;;
;;                                                                               ;;
;;  Program will insert a specific block at points as listed in either txt or    ;;
;;  csv file. If attribute values follow the points listed, then these will be   ;;
;;  entered into the block.                                                      ;;
;;                                                                               ;;
;;  Input File format should be as follows:-                                     ;;
;;  --------------------------------------------                                 ;;
;;  x-coord y-coord z-coord attrib(1) attrib(2) attrib(3) ... attrib(n)          ;;
;;                                                                               ;;
;;  If txt file is used, these values should be separated by a space, if a csv   ;;
;;  file is used, the values should be in adjacent cells.                        ;;
;;                                                                               ;;
;;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=;;
;;                                                                               ;;
;;  FUNCTION SYNTAX:  BlkIns                                                     ;;
;;                                                                               ;;
;;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=;;
;;                                                                               ;;
;;  AUTHOR:                                                                      ;;
;;                                                                               ;;
;;  Copyright © Lee McDonnell, December 2009. All Rights Reserved.               ;;
;;                                                                               ;;
;;      { Contact: Lee Mac @ TheSwamp.org, CADTutor.net }                        ;;
;;                                                                               ;;
;;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=;;
;;                                                                               ;;
;;  VERSION:                                                                     ;;
;;                                                                               ;;
;;    ø 1.0   ~¤~   5th December 2009   ~¤~   º First Release                    ;;
;;...............................................................................;;
;;    ø 1.1   ~¤~   5th December 2009   ~¤~   º Added Dialog interface.          ;;
;;...............................................................................;;
;;                                                                               ;;
;;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=;;
;;                                                                               ;;
;;;¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,;;;
;;;ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,¤º°`°º¤;;;

 

Comment/Criticism and Suggestions are Welcome,

 

Lee

BlkIns.zip

Link to comment
Share on other sites

I realise that this is quite a simple program as coding goes, but it has been requested more times than I can remember, so I thought I'd try to write a half decent one. :P

 

So here goes...

 

All instructions are in the header, will read txt or csv :)

 

;;;¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,;;;
;;;ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,¤º°`°º¤;;;
;;                                                                               ;;
;;                                                                               ;;
;;                          --=={  Block Insertor  }==--                         ;;
;;                                                                               ;;
;;  Program will insert a specific block at points as listed in either txt or    ;;
;;  csv file. If attribute values follow the points listed, then these will be   ;;
;;  entered into the block.                                                      ;;
;;                                                                               ;;
;;  Input File format should be as follows:-                                     ;;
;;  --------------------------------------------                                 ;;
;;  x-coord y-coord z-coord attrib(1) attrib(2) attrib(3) ... attrib(n)          ;;
;;                                                                               ;;
;;  If txt file is used, these values should be separated by a space, if a csv   ;;
;;  file is used, the values should be in adjacent cells.                        ;;
;;                                                                               ;;
;;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=;;
;;                                                                               ;;
;;  FUNCTION SYNTAX:  BlkIns                                                     ;;
;;                                                                               ;;
;;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=;;
;;                                                                               ;;
;;  AUTHOR:                                                                      ;;
;;                                                                               ;;
;;  Copyright © Lee McDonnell, December 2009. All Rights Reserved.               ;;
;;                                                                               ;;
;;      { Contact: Lee Mac @ TheSwamp.org, CADTutor.net }                        ;;
;;                                                                               ;;
;;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=;;
;;                                                                               ;;
;;  VERSION:                                                                     ;;
;;                                                                               ;;
;;    ø 1.0   ~¤~   5th December 2009   ~¤~   º First Release                    ;;
;;...............................................................................;;
;;    ø 1.1   ~¤~   5th December 2009   ~¤~   º Added Dialog interface.          ;;
;;...............................................................................;;
;;                                                                               ;;
;;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=;;
;;                                                                               ;;
;;;¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,;;;
;;;ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,¤º°`°º¤;;;

 

Comment/Criticism and Suggestions are Welcome,

 

Lee

Probably should mention that in order for the program to utilize any attributes in the input file, the block to be inserted must have attributes, or else only the vanilla block gets inserted at x,y,z.

just my 2cents.

Link to comment
Share on other sites

Probably should mention that in order for the program to utilize any attributes in the input file, the block to be inserted must have attributes, or else only the vanilla block gets inserted at x,y,z.

just my 2cents.

 

True, but I thought it was pretty obvious that the attributes will only be entered in an attributed block... but maybe you're right/ :wink:

Link to comment
Share on other sites

Does anybody has a lisp for drawing a 3dpolyline from a txt, excel or csv file with points coordinates? Thanks!

 

Flopo - this is unrelated to the thread in which you have posted it.

Link to comment
Share on other sites

  • 3 years later...

In addition to importing blocks at specific coordinates and with attributes, could anyone help me add a functionality to this code such that blocks can have x-, y-, and z-scale set as well, also from the TXT or CSV?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...