SNAPPING ZERO POINT INTO ELEVATION OF OVERLAP POINT

SNAPPING ZERO POINT INTO ELEVATION OF OVERLAP POINT

mohammad.kourani2012
Contributor Contributor
969 Views
9 Replies
Message 1 of 10

SNAPPING ZERO POINT INTO ELEVATION OF OVERLAP POINT

mohammad.kourani2012
Contributor
Contributor

Gents,

I have points on zero elevation with label text as field (z value of these points) I have assigned elevation for these points using civil3d but I lost the field text. I need to snap the original points to the new elevation point.

I am thinking in point projection to elevation or point snap or get z value from nearest neighborhood.

0 Likes
Accepted solutions (1)
970 Views
9 Replies
Replies (9)
Message 2 of 10

ВeekeeCZ
Consultant
Consultant

Post a dwg sample so we can better visualize your issue.

0 Likes
Message 3 of 10

mohammad.kourani2012
Contributor
Contributor

Thanks for your quick reply.

In the attached dwg file there are two points (green with true elevation and red on zero).

The MText has field reading the z value of the red point as you can see in the attached screenshot.

 

Thanks again,

0 Likes
Message 4 of 10

Sea-Haven
Mentor
Mentor

two solutions as you are using CIV3D you can create COGO points and simply label them with a Z civ3d style. 

 

In the sample dwg you have 2 Acad plain "POINT" so again 2 choices add a new label with field matching the correct point by layer or move the zero elev point to the other Z value.

 

Fo me erase existing label and make a new one. You need to confirm do you need both points or use CIV3D functions ?

0 Likes
Message 5 of 10

mohammad.kourani2012
Contributor
Contributor

Thanks bro,

The issue that the CAD operators are already finalized the labeling (size and rotation for bulk points).

usually they move the red point by snapping to the green point but I am trying to find a lisp to automate the work.

 

Thanks,

0 Likes
Message 6 of 10

ВeekeeCZ
Consultant
Consultant
Accepted solution

Try this to match the elevations.

 

(vl-load-com)

(defun c:PointsToZ ( / s i e o n p)

  (if (setq s (ssget "_X" '((0 . "POINT"))))
    (repeat (setq i (sslength s))
      (setq e (ssname s (setq i (1- i))))
      (if (zerop (getpropertyvalue e "Position/Z"))
	(setq o (cons (cons (getpropertyvalue e "Position") e) o))
	(setq n (cons (cons (getpropertyvalue e "Position") e) n)))))
  (foreach e o
    (if (and (setq p (list (caar e) (cadar e)))
	     (setq l (vl-remove-if-not '(lambda (x) (equal p (list (caar x) (cadar x)) 1e-8)) n)))
      (setpropertyvalue (cdr e) "Position" (caar l))))
  (princ)
  )
Message 7 of 10

mohammad.kourani2012
Contributor
Contributor

BeeKeeCZ,

Really I appreciate your magic touch thank you very much.

 

Regards,

0 Likes
Message 8 of 10

calderg1000
Mentor
Mentor

Regards  @mohammad.kourani2012 

It seems to me that you are doing double work, from C3D to Cad to obtain Volume. It is not logical. How do you calculate the volume...?
Still, routine helps.
Try this code that only selects the points that are on the "Old elevation" and "new elevation" Layers

 

 

(defun c:Ch_Elev (/ sp i spn p snp spo spon)
  (setq sp (ssget "_a" '((0 . "point") (8 . "new elevation"))))
  (repeat (setq i (sslength sp))
    (setq spn (ssname sp (setq i (1- i)))
          ps  (assoc 10 (entget spn))
          p   (cdr ps)
          snp (ssget "c"
                     p
                     p
                     '((0 . "point") (8 . "old elevation"))
              )
          spo (entget (ssname snp 0))
    )
    (entmod (subst ps (assoc 10 spo) spo))
    (entdel spn)
  )
  (princ)
)

 

 

 

 


Carlos Calderon G
EESignature
>Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

0 Likes
Message 9 of 10

mohammad.kourani2012
Contributor
Contributor

Hello,

 

I am sorry did not sign in from long time.

No Our shop drawings team they work CAD and they have blocks for annotation (text with field).

If the blocks are exploded and they need to update the drawing they have to enter the new elevation one by one.

In this case they can snap the old point to the point exported from C3D.

If the block is not exploded then I can assign the elevation directly from surface.

 

0 Likes
Message 10 of 10

mohammad.kourani2012
Contributor
Contributor

Hello,

What will do if you have 100,000 points? and every label is different rotation?

What if the company are paying civil3d license for 1 PC and AutoCAD for 20 PCs?

 

0 Likes