Thai3Dviz  

Go Back   Thai3Dviz > AutoCad > ห้องดราฟ (AutoCad)

ห้องดราฟ (AutoCad) ข่าวน่าสนใจ ,ถาม ตอบปัญหา เกี่ยวกับโปรแกรม AutoCad

Reply
 
Share Thread Tools Display Modes
Old 28-09-2007, 09:04 AM   #1
mvp
สมาชิกไทยวิซ
 
Join Date: Dec 2006
Posts: 34
mvp is on a distinguished road
Default อยากทราบว่ามี LSP สำหรับงาน SERVAY หรือเปล่าครับ

อยากทราบว่ามี LISP สำหรับงาน SERVAY หรือเปล่าครับเพราะเคยใช้อยู่บริษัทเก่าจะเป็น PTOS.lsp จะต้องไปป้อนค่าโคออดิเนตที่ EXCEL แล้วค่อยส่งไปที่ CAD ที่จอ CAD จะขึ้นเป็น point ให้ โดยมีค่า N,E นะคับแล้วก็ลากเส้นตามพิกัดได้เลย พอดี FORMATเครื่องไปแล้วเลยไม่มี LISP ตัวนี้แล้วไม่ทราบว่ามีตัวอื่นอีกไหมครับที่ใช้สำหรั บงาน SERVAY นะครับ
mvp is offline  

Reply With Quote
Old 30-09-2007, 05:40 PM   #2
sultan
สมาชิกไทยวิซ
 
sultan's Avatar
 
Join Date: Oct 2006
Posts: 75
sultan is on a distinguished road
Send a message via ICQ to sultan Send a message via MSN to sultan
Default

ผมมีตัวนี้เอาไปลองดูนะครับ ขออนุญาติโพสท์ในนี้เลยนะครับ

; ASCPOINT.LSP Copyright 1990,91 Tony Tanzillo All Rights Reserved.
;
; ASCPOINT.LSP is a utility for use with AutoCAD Release 10 or 11,
; which reads coordinate data from ASCII files in CDF or SDF format,
; and generates AutoCAD geometry using the incoming coordinate data.
;
; The ASCPOINT command will read coordinate data from an ASCII file,
; and generate either a continuous string of LINES, a POLYLINE, a
; 3DPOLYline, multiple copies of a selected group of objects, or
; AutoCAD POINT entities.
;
; Format:
;
; Command: ASCPOINT
; File to read: MYFILE.TXT <- ASCII input file
; Comma/Space delimited <Comma>: Comma <- data format
; Generate Copies/Lines/Nodes/3Dpoly/<Pline>: Nodes <- entity to create
; Reading coordinate data...
;
; If you selected "Copies", then ASCPOINT will prompt you to select the
; objects that are to be copied. The basepoint for all copies is the
; current UCS origin (0,0,0). One copy of the selected objects will be
; created for each incoming coordinate, and placed at each coordinate.
;
; A comma-delimited (CDF) ascii file contains one coordinate per line,
; with each component seperated by a comma, like this:
;
; 2.333,4.23,8.0
; -4.33,0.0,6.3
; 0.322,5.32,0.0
; etc....
;
; There should be no spaces or blank lines in a CDF coordinate data file.
;
; A space-delimited (SDF) ascii file contains one coordinate per line,
; with each component seperated by one or more spaces, like this:
;
; 2.333 4.23 8.0
; -4.33 0.0 6.3
; 0.322 5.32 0.0
; ...
;
; Coordinate data can be 2D or 3D.
;
; Note that all numeric values must have at least one digit to the left
; and the right of the decimal point (values less than one must have a
; leading 0), and a leading minus sign indicates negative values. This
; applys to both CDF and SDF formats.
;
; ASCPOINT can generate a continuous chain of LINEs entities from your
; coordinate data, where each pair of adjacent lines share a coordinate
; from the file.
;
; ASCPOINT can also generate a polyline or 3DPOLYline from the coordinate
; data, where each point in the file becomes a vertice of the polyline.
; If the input file contains 3D coordinates, and you specify a polyline,
; then the Z component is ignored and the default of 0.0 is used.
;
; ASCPOINT will also COPY a selected group of objects, creating one copy
; for each incoming coordinate, and using the coordinate as the absolute
; copy displacement from the CURRENT UCS origin (0,0,0).
;
; Finally, ASCPOINT will generate AutoCAD POINT entities from the data in
; the file. Specify the point size and type prior to invoking ASCPOINT.
;
; Good luck,
;
; Tony Tanzillo

(defun C:ASCPOINT ( / f bm hi format input read-point line plist ss)
(cond ( (eq "" (setq f (getstring "\nFile to read: "))))
( (not (setq f (open f "r")))
(princ "\nCan't open file for input."))
(t (initget 1 "Space Comma Comma")
(setq format
(getkword "\nComma/Space delimited <Comma>: "))
(initget 1 "Copies Lines Nodes 3dpoly Pline Pline")
(setq input
(cdr (assoc
(getkword "\nGenerate Copies/Lines/Nodes/3Dpoly/<Pline>: ")
'(("Lines" . ".line")
("Copies" . ".copy")
("Nodes" . ".point")
("3Dpoly" . ".3dpoly")
("Pline" . ".pline")))))
(setq read-point (cond ( (eq format "Comma") cdf)
(t sdf)))
(setvar "cmdecho" 0)
(command ".undo" "g")
(setq bm (getvar "blipmode"))
(setq hi (getvar "highlight"))
(setvar "blipmode" 0)
(princ "\nReading coordinate data...")
(while (setq line (read-line f))
(cond ( (setq line (strtrim line))
(setq line (read-point line))
(setq plist (append plist
(cond ( (eq input ".pline")
(list (noz line)))
(t (list line))))))))
(close f)
(cond ( (eq input ".point")
(setvar "highlight" 0)
(command ".point" "0,0,0"
".copy" (setq ss (entlast)) "" "m" "0,0,0")
(apply 'command plist)
(command)
(entdel ss))
( (eq input ".copy")
(princ "\nSelect objects to copy,")
(while (not (setq ss (ssget)))
(princ "\nNo objects selected,")
(princ " select objects to copy,"))
(setvar "highlight" 0)
(command ".copy" ss "" "m" "0,0,0")
(apply 'command plist)
(command))
(t (command input)
(apply 'command plist)
(command)))
(command ".undo" "e")
(setvar "highlight" hi)
(setvar "blipmode" bm)))
(princ)
)

(defun cdf (l)
(command ".setvar" "lastpoint" l)
(getvar "lastpoint")
)

(defun sdf (l)
(read (strcat "(" l ")"))
)

(defun noz (p)
(list (car p) (cadr p))
)

(defun strtrim (s)
(while (eq " " (substr s 1 1))
(setq s (substr s 2)))
(while (eq " " (substr s (strlen s)))
(setq s (substr s 1 (1- (strlen s)))))
(cond ( (eq s "") nil)
(t s))
)
sultan is offline   Reply With Quote
Old 16-11-2010, 01:17 PM   #3
anan_h
สมาชิกไทยวิซ
 
Join Date: Nov 2010
Posts: 4
anan_h is on a distinguished road
Default

Quote:
Originally Posted by sultan View Post
ผมมีตัวนี้เอาไปลองดูนะครับ ขออนุญาติโพสท์ในนี้เลยนะครับ

; ASCPOINT.LSP Copyright 1990,91 Tony Tanzillo All Rights Reserved.
;
; ASCPOINT.LSP is a utility for use with AutoCAD Release 10 or 11,
; which reads coordinate data from ASCII files in CDF or SDF format,
; and generates AutoCAD geometry using the incoming coordinate data.
;
; The ASCPOINT command will read coordinate data from an ASCII file,
; and generate either a continuous string of LINES, a POLYLINE, a
; 3DPOLYline, multiple copies of a selected group of objects, or
; AutoCAD POINT entities.
;
; Format:
;
; Command: ASCPOINT
; File to read: MYFILE.TXT <- ASCII input file
; Comma/Space delimited <Comma>: Comma <- data format
; Generate Copies/Lines/Nodes/3Dpoly/<Pline>: Nodes <- entity to create
; Reading coordinate data...
;
; If you selected "Copies", then ASCPOINT will prompt you to select the
; objects that are to be copied. The basepoint for all copies is the
; current UCS origin (0,0,0). One copy of the selected objects will be
; created for each incoming coordinate, and placed at each coordinate.
;
; A comma-delimited (CDF) ascii file contains one coordinate per line,
; with each component seperated by a comma, like this:
;
; 2.333,4.23,8.0
; -4.33,0.0,6.3
; 0.322,5.32,0.0
; etc....
;
; There should be no spaces or blank lines in a CDF coordinate data file.
;
; A space-delimited (SDF) ascii file contains one coordinate per line,
; with each component seperated by one or more spaces, like this:
;
; 2.333 4.23 8.0
; -4.33 0.0 6.3
; 0.322 5.32 0.0
; ...
;
; Coordinate data can be 2D or 3D.
;
; Note that all numeric values must have at least one digit to the left
; and the right of the decimal point (values less than one must have a
; leading 0), and a leading minus sign indicates negative values. This
; applys to both CDF and SDF formats.
;
; ASCPOINT can generate a continuous chain of LINEs entities from your
; coordinate data, where each pair of adjacent lines share a coordinate
; from the file.
;
; ASCPOINT can also generate a polyline or 3DPOLYline from the coordinate
; data, where each point in the file becomes a vertice of the polyline.
; If the input file contains 3D coordinates, and you specify a polyline,
; then the Z component is ignored and the default of 0.0 is used.
;
; ASCPOINT will also COPY a selected group of objects, creating one copy
; for each incoming coordinate, and using the coordinate as the absolute
; copy displacement from the CURRENT UCS origin (0,0,0).
;
; Finally, ASCPOINT will generate AutoCAD POINT entities from the data in
; the file. Specify the point size and type prior to invoking ASCPOINT.
;
; Good luck,
;
; Tony Tanzillo

(defun C:ASCPOINT ( / f bm hi format input read-point line plist ss)
(cond ( (eq "" (setq f (getstring "\nFile to read: "))))
( (not (setq f (open f "r")))
(princ "\nCan't open file for input."))
(t (initget 1 "Space Comma Comma")
(setq format
(getkword "\nComma/Space delimited <Comma>: "))
(initget 1 "Copies Lines Nodes 3dpoly Pline Pline")
(setq input
(cdr (assoc
(getkword "\nGenerate Copies/Lines/Nodes/3Dpoly/<Pline>: ")
'(("Lines" . ".line")
("Copies" . ".copy")
("Nodes" . ".point")
("3Dpoly" . ".3dpoly")
("Pline" . ".pline")))))
(setq read-point (cond ( (eq format "Comma") cdf)
(t sdf)))
(setvar "cmdecho" 0)
(command ".undo" "g")
(setq bm (getvar "blipmode"))
(setq hi (getvar "highlight"))
(setvar "blipmode" 0)
(princ "\nReading coordinate data...")
(while (setq line (read-line f))
(cond ( (setq line (strtrim line))
(setq line (read-point line))
(setq plist (append plist
(cond ( (eq input ".pline")
(list (noz line)))
(t (list line))))))))
(close f)
(cond ( (eq input ".point")
(setvar "highlight" 0)
(command ".point" "0,0,0"
".copy" (setq ss (entlast)) "" "m" "0,0,0")
(apply 'command plist)
(command)
(entdel ss))
( (eq input ".copy")
(princ "\nSelect objects to copy,")
(while (not (setq ss (ssget)))
(princ "\nNo objects selected,")
(princ " select objects to copy,"))
(setvar "highlight" 0)
(command ".copy" ss "" "m" "0,0,0")
(apply 'command plist)
(command))
(t (command input)
(apply 'command plist)
(command)))
(command ".undo" "e")
(setvar "highlight" hi)
(setvar "blipmode" bm)))
(princ)
)

(defun cdf (l)
(command ".setvar" "lastpoint" l)
(getvar "lastpoint")
)

(defun sdf (l)
(read (strcat "(" l ")"))
)

(defun noz (p)
(list (car p) (cadr p))
)

(defun strtrim (s)
(while (eq " " (substr s 1 1))
(setq s (substr s 2)))
(while (eq " " (substr s (strlen s)))
(setq s (substr s 1 (1- (strlen s)))))
(cond ( (eq s "") nil)
(t s))
)
อยากได้วิธีใช้งานด้วยครับ
ขอบคุณ
anan_h is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +7. The time now is 07:28 PM.

Design Developed by CompleteGFX
Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
Copyright ©2002-2010 Thai3dViz Co.,Ltd.
Hosting by THAISITE.net