Jump to content

Recommended Posts

Posted

I am working on a project where I have a text file in PNEZD format and the points are for objects like valves,hydrants,manholes,etc. I need to describe the valve characteristics such as diameter, year installed, condition, etc.

 

Here is a sample line of text from the input file.

 

1,226694.800,12550548.686,587.976,valve 12 1987 good

 

What I am doing right now is importing the points so the string "valve 12 1987 good" shows up as a description, then I am creating a block and manually entering each of these characteristics into the attributes. I need to do this so I can sort them out and , for example, see ONLY valves of 8" diameter, or see ONLY valves installed before 1980. Right now I am using ATTOUT to analyze them in excel and have also tried EATTEXT but didn't ilke it since it converts everything to a text cell. But back to my main question...

 

Is there anyway to import the points and have civil 3d automatically assign blocks/attributes to each point based on the description?

 

Thanks for the help. These forums are a great place to learn.:)

Posted

Not a problem you need a lisp or vba, need to combine two steps create points at xyz and insert a block with the attributes on the end of the line.

 

 

Search here for the insert points from file, You then need a read line lisp or vba that can create new variables X Y Z ANS1 ANS2 ANS3 ANS4. I would suggest use word etc replace spaces with , (comma seperated file) makes reading line easier search for comma in string maybe even search here for excell to Autocad block insert I think I have seen that.

Posted

Sorry heres some starting code

 

(setq x 1)
(defun xyz ()
 (setq ans "")
 (setq char_found "")
 (while (/= char_found ",")
   (setq char_found (substr new_line x 1))
   (setq x (+ x 1))
   (setq ans (strcat ans char_found))
 )                    ;end while
)        

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...