Jump to content

Recommended Posts

Posted

Hi,

 

I am new to this forum.i hope that some body can help me out here.

now i have a situation to create pile layout with coordinates.i have the coordinates of pile in excel format ( total 934 nos ).is any auto lisp can place the

piles in the actual coordinates with the number ,Coordinates and the cutoff level ...i mean number+coordinates x,yz.pile dia 750mm

 

Please help me

 

Regards

  • Replies 32
  • Created
  • Last Reply

Top Posters In This Topic

  • Tharwat

    11

  • MSasu

    8

  • vinish

    4

  • BIGAL

    2

Top Posters In This Topic

Posted

Welcome to the forum :)

 

Can you upload a copy of Excel file and a drawing contains pile block ?

Posted

Hi and welcome again!

 

I changed the title of your thread, please use descriptive titles in the future.

 

Good luck!

Posted

You can also use excel to write a line of autocad commands based on your info then either past this column directly to the commnad line or save it as a script file.

 

in excel CONCATENATE (text1,text2,...) CONCATENATE ("insert borehole ",b1,",",c1,"1 0',d1,"point",b1,",",c1,......)

 

 

so PtNo x y z depthe etc
1 110 100 -25    becomes a new column->   Insert borehole x,y 1 0 Z Point x,y Text x,y  0 ptno just copy down in excel. 

Posted

Thanks for the respond Tharwat.

 

some coordinates of the piles area shown below.

i don't want to use the block ....just i want to draw the circles with the coordinates automatically,

with the help of a script or lisp file.

 

 

PILE NO EASTING NORTHING CUTOFF LEVEL DIA

596 490554.848 2788544.836 - 0.700 75MM

597 490558.101 2788542.425 - 0.700 75MM

598 490561.439 2788540.138 - 0.700 75MM

599 490565.728 2788537.199 - 0.700 75MM

600 490570.431 2788533.978 - 1.500 75MM

601 490578.165 2788526.752 + 2.550 75MM

602 490579.225 2788528.299 + 2.550 75MM

603 490580.561 2788530.247 + 2.550 75MM

604 490582.459 2788524.946 + 2.550 75MM

605 490584.094 2788526.205 + 2.550 75MM

606 490585.154 2788527.751 + 2.550 75MM

607 490584.006 2788523.886 + 2.550 75MM

608 490587.171 2788524.096 + 2.550 75MM

609 490588.231 2788525.643 + 2.550 75MM

610 490588.402 2788521.855 + 2.650 75MM

611 490589.949 2788520.795 + 2.650 75MM

612 490592.115 2788519.312 + 2.550 75MM

613 490593.048 2788521.205 + 2.550 75MM

614 490593.661 2788518.252 + 2.550 75MM

615 490594.595 2788520.145 + 2.550 75MM

616 490595.455 2788517.022 + 2.550 75MM

617 490597.002 2788515.962 + 2.550 75MM

618 490599.433 2788516.502 + 2.550 75MM

619 490600.98 2788515.442 + 2.550 75MM

Posted

Thanks for the advise Tiger,

 

Need lisp to draw line from coordinates

 

"Need lisp to draw circles from coordinates "

Posted
Thanks for the respond Tharwat.

 

some coordinates of the piles area shown below.

i don't want to use the block ....just i want to draw the circles with the coordinates automatically,

with the help of a script or lisp file.

 

PILE NO EASTING NORTHING CUTOFF LEVEL DIA

596 490554.848 2788544.836 - 0.700 75MM

 

 

Can you copy all these data to a notepad file and after that use a lisp to import them as values ?

Do you want the pile number inside the circle ?

What's this CUTOFF number ?

 

Thanks

Posted
Can you copy all these data to a notepad file and after that use a lisp to import them as values ?

 

The data can be saved directly from Excel in CSV format.

 

Regards,

Mircea

Posted
The data can be saved directly from Excel in CSV format.

 

Regards,

Mircea

 

To use a .txt file is much more faster than using Excel file ( csv or xlsx ) to import values into cad , and that's what I meant ;)

Posted
To use a .txt file is much more faster than using Excel file ( csv or xlsx )

 

CSV (Comma Separated Values) format is just a simple ASCI file, there is no difference from TXT format. The advantage is that data inside is well formatted.

 

Regards,

Mircea

Posted
CSV (Comma Separated Values) format is just a simple ASCI file, there is no difference from TXT format. The advantage is that data inside is well formatted.

 

Regards,

Mircea

 

Thank you Mircea .:thumbsup:

 

That's new to me .

Posted
Can you copy all these data to a notepad file and after that use a lisp to import them as values ?

Do you want the pile number inside the circle ?

What's this CUTOFF number ?

 

yes i want the pile number inside the circle.cut off level is " Z " value.

 

Regards____.

Posted

Copy all your data from Excel file to a notepad and save them as ( txt file ) and after that try this code .

 

Note : Form of strings must be as you brought in post No # 6

 

Good luck .... :)

 

(defun c:Test (/ filename openfile string pos lst p h)
 ;;;       Tharwat 27. March . 2012           ;;;
 ;;  form of the string must be as following    ;
 ;  "596 490554.848 2788544.836 - 0.700 75MM"   ;
 ; 596        = Number inside the circle       ;
 ; 490554.848    = x                              ;
 ; 2788544.836    = y                              ;
 ; - 0.700    = z                              ;
 ; 75MM    = diameter of circle             ;
 
 (if (setq filename (getfiled "Select txt file ..."
                              (getvar 'dwgprefix)
                              "txt"
                              8
                    )
     )
   (progn
     (setq openfile (open filename "r"))
     (while
       (setq string (read-line openfile))
        (while string
          (if (setq pos (vl-string-search " " string))
            (progn
              (setq lst (cons (substr string 1 pos) lst))
              (setq string (substr string (+ pos 2)))
            )
            (progn
              (setq lst (cons string lst))
              (setq string nil)
            )
          )
        )
        (setq lst (reverse lst))
        (entmakex
          (list
            '(0 . "CIRCLE")
            (cons 10
                  (setq p
                         (list (read (nth 1 lst))
                               (read (nth 2 lst))
                               (read (strcat (nth 3 lst) (nth 4 lst)))
                         )
                  )
            )
            (cons 40
                  (setq h (read (vl-string-right-trim "MM" (nth 5 lst))))
            )
          )
        )
        (entmakex (list '(0 . "TEXT")
                        (cons 10 p)
                        (cons 11 p)
                        (cons 1 (car lst))
                        (cons 40 (/ h 2.))
                        (cons 7 (getvar 'textstyle))
                        '(50 . 0.)
                        '(71 . 0)
                        '(72 . 1)
                        '(73 . 2)
                        '(210 0.0 0.0 1.0)
                  )
        )
        (setq lst nil)
     )
   )
   (princ)
 )
 (princ)
)

Posted

One comment, it you will copy-paste data from Excel to Notepad, I'm afraid that the separator will be character (ASCII code 9) and not the space as used in your code.

 

Regards,

Mircea

Posted
One comment, it you will copy-paste data from Excel to Notepad, I'm afraid that the separator will be character (ASCII code 9) and not the space as used in your code.

 

Regards,

Mircea

 

That's what happened when I tested the code in Cad 2010 , but with cad 2009 it considered the space as a space .

So if it needs to change the search for \t instead of space , i would be more than happy to replace it when I have sometime .

 

Thanks for your comment Mircea . :)

 

Regards.

Posted

That had nothing to do with AutoCAD's version; it is just the way Excel is sending data to Clipboard.

 

Regards,

Mircea

Posted

it is very simple . :)

 

just replace this ..

 

(if (setq pos (vl-string-search " " string))              (progn ..
                      ....

with this ...

 

(if (setq pos (vl-string-search "\t" string))              (progn....
                   .....

Posted

Mircea, user can always replace char. with find&replace option from notepad...

 

Tharwat, variable filename must be string of complete HD path + filename so consider changing integer of (getfiled) from 8 to 16...

 

M.R.

Posted

I suppose that you just copied the data from OP's post and from there you got space as separator - please keep in mind that he probably pasted that from Excel, but in HTML the character is automatically replaced with space unless special formatting tags are added.

 

Regards,

Mircea

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