Author Topic: xsection form file data  (Read 1254 times)

0 Members and 1 Guest are viewing this topic.

pedroantonio

  • Guest
xsection form file data
« on: May 04, 2014, 12:04:21 PM »
Hi , i need a litle help.I am trying to write a lisp  drawind x sections . Look the attach photo and the comments in the code.I attach 2 data files for ground 1 and ground 2

Code - Auto/Visual Lisp: [Select]
  1. ;xsection form file data
  2.  
  3. (defun c:xsection( / fn fp lst l p1 p2 oldOSM )
  4.   (COMMAND "_layer" "_m" "ground1" "_c" "8" "" "")
  5.   (COMMAND "_layer" "_m" "ground2" "_c" "3" "" "")
  6. ; if we have a 2d ground line
  7.   (COMMAND "_layer" "_m" "text_ground1" "_c" "8" "" "")
  8.   (COMMAND "_layer" "_m" "text_ground2" "_c" "3" "" "")
  9.   (COMMAND "_layer" "_m" "name of section" "_c" "1" "" "")
  10.   (COMMAND "_layer" "_m" "datum" "_c" "1" "" "")
  11.   (COMMAND "_layer" "_m" "scale" "_c" "1" "" "")
  12.   (COMMAND "_layer" "_m" "Vertical lines" "_c" "140" "" "")
  13.   (COMMAND "_layer" "_m" "Vertical yellow line" "_c" "2" "" "")
  14. (setq ns (getreal  "\n give name of the section : "))
  15. (setq dtm (getreal  "\n give datum elevetion : "))
  16. (setq scl(/ (getreal  "\n give scale  (100,200,500,etc) : ") 100))
  17. (setq ht(* 0.175 scl))
  18. (setq fn (getfiled "Select ASCII file for ground 1" "" "txt" 4))
  19. ;
  20. ; I want to add a command when i whant in second time to add ground 2
  21. ;ask me.Do you have another ground line (Y/N)
  22. ;When i answer  Yes then load ASCII file for ground 2
  23. ;(setq fe (getfiled "Select ASCII file for ground 2" "" "txt" 4))
  24. ;And ask me to pick the inset point for the ground 2 like the photo
  25. ;Look the photo to see the insert point of ground 2
  26.  
  27.  
  28.   (setq fp (open fn "r") lst '())
  29.   (while (setq l (read-line fp))
  30.     (setq lst (cons l lst))
  31.   )
  32.   (close fp)
  33.   (setq lst (reverse lst))
  34.   (setq oldOSM (getvar "osmode"))
  35.   (setvar "osmode" 0)
  36.  
  37.   (command "._pline" "")
  38.   (foreach item lst
  39.    (if (/= item "")
  40.     (command item)
  41.     (command "" "._pline")
  42.    )
  43.   )
  44.   (command "")
  45. ;)
  46.  (setvar "osmode" oldOSM)
  47.  (princ)
  48. )
  49.  
  50. ;
  51. ;write data to the table .(I need help for this)
  52. ;
  53.  

Thanks

snownut2

  • Swamp Rat
  • Posts: 959
  • Bricscad 20 Ultimate
Re: xsection form file data
« Reply #1 on: May 04, 2014, 01:40:44 PM »
Pedro,

The stationing method seems very odd, usually stationing is at some even interval, with additional stations for PC, PT, intersections and possibly structure locations and others.  I do not believe you have been forthcoming with enough information to come to a reasonable conclusion on how to proceed. (as usual)

What you are asking for here could evolve into quite a function, especially since you give no clear direction.  Are you looking for profile design with vertical curve design based on K factors etc.  There are lots of commercially available programs already developed for just this type of application.  Are you also looking to generate this profile off a 2d road center-line, using underlying contours or surface to create existing conditions profile?  Why not just ask for automatic x-section profiles based on any number of variables at specified intervals while you are at it.

pedroantonio

  • Guest
Re: xsection form file data
« Reply #2 on: May 04, 2014, 06:31:55 PM »
Hi snownut2 can you help?

Thanks

pedroantonio

  • Guest
Re: xsection form file data
« Reply #3 on: May 05, 2014, 12:37:19 PM »
Any ideas ?

pedroantonio

  • Guest
Re: xsection form file data
« Reply #4 on: May 06, 2014, 12:18:07 PM »
Quote
Pedro,

The stationing method seems very odd, usually stationing is at some even interval, with additional stations for PC, PT, intersections and possibly structure locations and others.  I do not believe you have been forthcoming with enough information to come to a reasonable conclusion on how to proceed. (as usual)

What you are asking for here could evolve into quite a function, especially since you give no clear direction.  Are you looking for profile design with vertical curve design based on K factors etc.  There are lots of commercially available programs already developed for just this type of application.  Are you also looking to generate this profile off a 2d road center-line, using underlying contours or surface to create existing conditions profile?  Why not just ask for automatic x-section profiles based on any number of variables at specified intervals while you are at it.

I use 3d polylines for the section.The section start all the times from the left to right. Look the direction from the dwg.Then I want to use txt files to draw xsection like the photo (post1).I need something like the photo.

Thanks


pedroantonio

  • Guest
Re: xsection form file data
« Reply #5 on: May 10, 2014, 10:42:07 AM »
Any other options?