Jump to content

Coverting a Polylines Vertices from OCS to UCS


Steve Johnstone

Recommended Posts

In the past I have written codes that manipulate the geometry of a polyline however I have only recently come across the issue of OCS's.

I wrote a code that extracts the polyline vertices and creates a table below indicating Chainages and RL's (Civil Engineering Sections).

This code worked well until I found that in some cases the vertex coordinates were not the same as the UCS coordinates, hence I discovered the world of OCS.

Does anyone have a lisp code that will convert the OCS coordinates into UCS, or advise the best way of doing it.

 

 

Thanks

Link to comment
Share on other sites

Your lucky day just had a play with the trans function you can convert a pt at User co-ords to world very simply. (setq wpt (trans ucspt 1 0))

Link to comment
Share on other sites

You can use:

(trans point_in_ocs normal_of_entity 1)

or:

(trans point_in_ocs ename_of_entity 1)

(setq enm (car (entsel)))
(setq elst (entget enm))
(setq elv (list (cdr (assoc 38 elst)))) ; Elevation.
(setq nor (cdr (assoc 210 elst)))       ; Extrusion or Normal.
(vl-remove
 nil
 (mapcar
   '(lambda (sub) (if (= 10 (car sub)) (trans (append (cdr sub) elv) nor 1)))
   elst
 )
)

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