Jump to content

Converting survey figures to polylines


aawilds

Recommended Posts

I am looking for a lisp that will allow me to convert survey figures to flat polylines. Currently I have to select them explode which makes 3dpolylines then convert to 2dpolylines. I then use the flatten command. I have tried making a lisp that uses (command "_explode") and (command "_flatten") and am having trouble getting them to work. Does anyone have any suggestions?

Link to comment
Share on other sites

IIRC, you can't pass arguments to the flatten command because it is defined with lisp itself.

 

The C3D command "3D to 2D polylines" works, sort of, but it doesn't move the items to 0.0 elevation.

 

Here is something with which to start. No error checking obviously.

 


(defun c:foo ()
 (setq ent (car (entsel "\nSelect Figure")))
 (vl-cmdf "explode" ent)
 (vl-cmdf "CONVERT3DPOLYS" "_L" "")
)

 

I suppose you could end the routine with (c:flatten) and then finish it off manually.

You could also set the explode to loop through a selection set, and then flatten the entire selection set.

Lot of ways to tackle this.

Link to comment
Share on other sites

Another way is to retrieve the 3d components and make a new pline erase old one.

This is not tested

; pline co-ords example
; By Alan H
(defun getcoords (ent)
 (vlax-safearray->list
   (vlax-variant-value
     (vlax-get-property
   (vlax-ename->vla-object ent)
   "Coordinates"
     )
   )
 )
)

(defun co-ords2xy ()
; convert now to a list of xy as co-ords are x y x y x y if 3d x y z x y z
(setq len (length co-ords))
(setq numb (/ len 2)) ; even and odd check required if frac is 0.5 then its odd has Z
(setq I 0)
(repeat numb
(setq xy (list (nth i co-ords)(nth (+ I 1) co-ords) ))
; odd (setq xy (list (nth i co-ords)(nth (+ I 1) co-ords)(nth (+ I 2) co-ords) ))
(setq co-ordsxy (cons xy co-ordsxy))
(setq I (+ I 2))
)
)
; program starts here
(setq co-ords (getcoords (car (entsel "\nplease pick pline"))))
(co-ords2xy) ; list of 2d points making pline
(command "_pline")
(repeat (setq x (length co-ordsxy))
(setq xy (nth (setq x (- x1)) co-ordsxy))
(command (list (nth 0 co-ordsxy)(nth 1 co-ordsxy)))
)

Link to comment
Share on other sites

The downside to exploding to 3d polylines is you don't get any curved segments. our procedure isn't create a rectangle, make it a break line in a temporary surface. set the elevations of the survey figures to match the temp surface (0), explode the feature lines, this makes them 2d. erase the surface and the rectangle. I'm not sure this can be done with lisp as it requires a little too much interaction.

Link to comment
Share on other sites

Look at Lee-mac website and he has a great pline routine including bulge info. One of the things with a bulge is that in 3d its a planar answer sometimes in the plane of the before and after lines, so the radius can be something different when converted to 2d. Bit hard to explain. Forcing the bulge points to be z=0.0 can make just that a bulge.

 

Also CIV3D does not support arcs as breaklines interesting our 20 year old software asks how many facets you want for arcs in break lines, often CIV3D is so far behind.

Link to comment
Share on other sites

I am looking for a lisp that will allow me to convert survey figures to flat polylines. Currently I have to select them explode which makes 3dpolylines then convert to 2dpolylines. I then use the flatten command. I have tried making a lisp that uses (command "_explode") and (command "_flatten") and am having trouble getting them to work. Does anyone have any suggestions?

 

Congratulations on your first post! What type of survey figures and what are you looking to do with them? There's usually several solutions to every problem with AutoCAD. Are these figures extractable?

Link to comment
Share on other sites

This is great, I did not know that flatten was it's own lisp. Being able to reduce the button clicks is a lifesaver. This helps a lot thank you.

Link to comment
Share on other sites

What type of survey figures and what are you looking to do with them?

 

I think OP answered that in the initial post.

 

...convert survey figures to flat polylines...
Link to comment
Share on other sites

I think OP answered that in the initial post.

 

Figures are editable and as this was a newbie poster they could be fairly new to Civil. There could be a really simple solution to what they're wanting to accomplish.

 

aawilds what type of survey figures and what are you going to use the polylines for?

Link to comment
Share on other sites

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