Jump to content

Point Manager


Lee Mac

Recommended Posts

  • Replies 149
  • Created
  • Last Reply

Top Posters In This Topic

  • Lee Mac

    69

  • keithlaser

    8

  • chulse

    6

  • SteveK

    6

Top Posters In This Topic

Posted Images

Have just tested and all seems fine to me.

 

To try to solve the issue, type this at the AutoCAD command line:

 

(findfile "LMAC_Ptman_V2.2.pdf")

 

If it returns a valid path, navigate to that path, delete the pdf file and re-run the program.

 

Lee

Link to comment
Share on other sites

sir,

I have downloaded the PDF file.In 2.2.1 it is said that "Select ‘Block’ from the Input Type drop-down (1)" but i am not getting the block in the input type.In input type iam getting file,point,lwpolyline,3d polyline.Actually i want to insert the corinates besides the point.Kindly help.

 

with regards

ravi

Link to comment
Share on other sites

  • 1 month later...

I have some small question to Lee. I need to import to Acad not a single polyline, but a large number of polylines. For example 100. As I think, in this case XYZ-coordinates of polylines (in TXT file ) can be divided by empty string. Could you upgrade your program for this task? Thanks!

Link to comment
Share on other sites

Hi Olegianna,

 

This could be done, but I wish to keep the program as generic as possible, hence dealing with a continuous list of points. However a custom program could be constructed to import your polylines, for example:

 

(defun c:ImportPolylines ( / *error* _StartUndo _EndUndo doc del f of lst sub n )
 (vl-load-com)
 ;; © Lee Mac 2010

 (setq del ",") ;; Data Delimiter

 (defun *error* ( msg )
   (if doc (_EndUndo doc)) (if of (close of))
   (or (wcmatch (strcase msg) "*BREAK,*CANCEL*,*EXIT*")
       (princ (strcat "\n** Error: " msg " **")))
   (princ)
 )

 (defun _StartUndo ( doc ) (_EndUndo doc)
   (vla-StartUndoMark doc)
 )

 (defun _EndUndo ( doc )
   (if (= 8 (logand 8 (getvar 'UNDOCTL)))
     (vla-EndUndoMark doc)
   )
 )

 (setq doc (vla-get-ActiveDocument (vlax-get-acad-object))
       spc (vlax-get doc (if (= 1 (getvar 'CVPORT)) 'Paperspace 'ModelSpace)))

 (if (setq f (getfiled "Select Data File" "" "txt" 16))
   (progn
     (setq of (open f "r"))

     (while (setq n (read-line of))
       (if (eq n "")
         (setq lst (cons sub lst) sub nil)
         (setq sub (cons (LM:Str->Lst n del) sub))
       )
     )
     (if sub (setq lst (cons sub lst)))

     (setq of (close of))

     (_StartUndo doc)

     (mapcar
       (function
         (lambda ( pointset )
           (vla-Add3DPoly spc (LM:PointVariant pointset))
         )
       )
       lst
     )

     (_EndUndo doc)
   )
   (princ "\n*Cancel*")
 )

 (princ)
)

;;------------------=={ String -> List }==--------------------;;
;;                                                            ;;
;;  Separates a string into a list of strings using a         ;;
;;  specified delimiter string                                ;;
;;------------------------------------------------------------;;
;;  Author: Lee McDonnell, 2010                               ;;
;;                                                            ;;
;;  Copyright © 2010 by Lee McDonnell, All Rights Reserved.   ;;
;;  Contact: Lee Mac @ TheSwamp.org, CADTutor.net             ;;
;;------------------------------------------------------------;;
;;  Arguments:                                                ;;
;;  str - string to process                                   ;;
;;  del - delimiter by which to separate the string           ;;
;;------------------------------------------------------------;;
;;  Returns:  A list of strings                               ;;
;;------------------------------------------------------------;;

(defun LM:Str->Lst ( str del / pos )
 ;; © Lee Mac 2010
 (if (setq pos (vl-string-search del str))
   (cons (substr str 1 pos)
     (LM:Str->Lst (substr str (+ pos 1 (strlen del))) del)
   )
   (list str)
 )
)

;;------------------=={ Safearray Variant }==-----------------;;
;;                                                            ;;
;;  Creates a populated Safearray Variant of a specified      ;;
;;  data type                                                 ;;
;;------------------------------------------------------------;;
;;  Author: Lee McDonnell, 2010                               ;;
;;                                                            ;;
;;  Copyright © 2010 by Lee McDonnell, All Rights Reserved.   ;;
;;  Contact: Lee Mac @ TheSwamp.org, CADTutor.net             ;;
;;------------------------------------------------------------;;
;;  Arguments:                                                ;;
;;  datatype - variant type enum (eg vlax-vbDouble)           ;;
;;  data     - list of static type data                       ;;
;;------------------------------------------------------------;;
;;  Returns:  VLA Variant Object of type specified            ;;
;;------------------------------------------------------------;;

(defun LM:SafearrayVariant ( datatype data )
 ;; © Lee Mac 2010
 (vlax-make-variant
   (vlax-safearray-fill
     (vlax-make-safearray datatype
       (cons 0 (1- (length data)))
     )
     data
   )    
 )
)

;;--------------------=={ Point Variant }==-------------------;;
;;                                                            ;;
;;  Creates a populated Safearray Variant of Double type.     ;;
;;------------------------------------------------------------;;
;;  Author: Lee McDonnell, 2010                               ;;
;;                                                            ;;
;;  Copyright © 2010 by Lee McDonnell, All Rights Reserved.   ;;
;;  Contact: Lee Mac @ TheSwamp.org, CADTutor.net             ;;
;;------------------------------------------------------------;;
;;  Arguments:                                                ;;
;;  lst - list of 2D/3D Points to populate the Variant.       ;;
;;------------------------------------------------------------;;
;;  Returns:  VLA Safearray Variant                           ;;
;;------------------------------------------------------------;;

(defun LM:PointVariant ( lst )
 ;; © Lee Mac 2010
 (LM:SafearrayVariant vlax-VBDouble (apply 'append lst))
)

Change the delimiter at the top of the code to suit.

Link to comment
Share on other sites

Hi Lee stringing points is a survey term that you join a whole lot of common coded points together ie lots of polylines 100+

 

This has been asked multiple times and yes a seperate routine would be best maybe called at the end of importing points as per your great program.

 

If you have p,x,y,z,c where you have a code attached eg c=01eb this is string 01 edge of bitumen left side c=02eb is right side.

 

If you take the p,x,y,z,c and sort on p point number first then you must resort on code so you end up with a file that is numerically correct but the codes are in sequence. Then quite simply draw pline when c changes start a new one.

 

Almost forgot 00 is a point

 

1,100,100,100,01eb

25,101,101,100,01eb

26,102,102,100,01eb

29,102,103,100,02eb

30,103,103,100,02eb

5,104,100,100,01f

6,105,103,100,01f and so on

 

The tricky bit is you really want a look up library that matches the code so you know what layer to use.

01eb&02eb = EDGE BIT

 

In CIV3D and other civil software this is built in. Maybe a .net ?

Edited by BIGAL
string 00
Link to comment
Share on other sites

Sounds quite complex BigAl - and would certainly deviate quite a lot from where the program currently stands - you see, I wanted to keep this very generic so that many users could benefit from the same program - and furthermore, if Civil3D already has the tools to handle such a task, I shouldn't want to spend a lot of time reinventing the wheel :)

 

But thanks for the suggestion in any case, I do welcome all the feedback :)

 

Lee

Link to comment
Share on other sites

Hi Olegianna,

 

This could be done, but I wish to keep the program as generic as possible, hence dealing with a continuous list of points. However a custom program could be constructed to import your polylines, for example:

 

 

Many thanks, Lee, for your quick reply! Unfortunately, I'm not a pro in autolisp, and therefore I'll need a lot of time to work on your code. But this task (polylines I mean) is a reason for me to start study a-lisp.

Link to comment
Share on other sites

Many thanks, Lee, for your quick reply! Unfortunately, I'm not a pro in autolisp, and therefore I'll need a lot of time to work on your code. But this task (polylines I mean) is a reason for me to start study a-lisp.

 

The example I provided shouldn't need any modification, it should perform as required :)

Link to comment
Share on other sites

Lee,

 

I was thinking for this to be a widely used point manager for civil surveyers/engineers, you should allow the program to have 5 fields delimited instead of three. The all of the lists in the Format dialog should have these additions in the pop_list: "none" (only on the fourth and fifth field) "point number" "Description" in all other fields as most surveyers field computers store and output a ASCII or ASC file with five delimited data fields. Then when Point number and or description is selected in the format dialog the program should create a text object and orientate per each point.

 

I have a file if you need something to trial with. Let me know, i am interested to see what you come up with.

 

Thank you so much for all your help in the past and i look forward to the help in the future.

 

-Matt

Link to comment
Share on other sites

Hi Matt,

 

Yes, I've received that suggestion before I believe - although I haven't worked on the program for a while and it would probably need a lot of rewriting to get it up to scratch!

 

I'll see what I can do when I get a moment :)

 

Lee

Link to comment
Share on other sites

  • 2 months later...

Hi Mr. Lee,

 

Thank u very much for you program. It is very useful for me especially when dealing with the mesh and LW/3D Polyline. However, when using autocad 2010, the created mesh will be a surface instead of a polygon mesh as in autocad 2008. I need to extract the vertices coordinates from the mesh. It was easily done when using autocad 2008 but not anymore since using autocad 2010. I also dont know how to convert a surface to polygon mesh so that your program can work. do you have any solution for me?

 

idhoe

Link to comment
Share on other sites

  • 2 weeks later...

Dear Lee

I already load .lsp file downloaded from your page in Autocad 2007, but unfortunately it didn't run and promt as we seen.

 

I'm a newbie. Pls. help me to solve this. Thanks in advance.

 

1-10-2011 10-05-35 AM.jpg

1-10-2011 10-05-35 AM.jpg

Link to comment
Share on other sites

Hi TheWhiteSand - Welcome to CADTutor.

 

How are you loading the program? - did you download and save the LISP file to your computer, or copy/paste from a browser window?

 

Lee

Link to comment
Share on other sites

  • 1 month later...

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