Jump to content

Spot Elevation Program


CadProWannabe

Recommended Posts

  • Replies 66
  • Created
  • Last Reply

Top Posters In This Topic

  • Lee Mac

    23

  • CadProWannabe

    12

  • eldon

    8

  • wizman

    8

Top Posters In This Topic

Posted Images

Ok that seems to be the problem, I work in 2d and all my points are inserted into the drawing with a fixed elevation of 0.00 that is how we draft. All linework is at a 0.00 elevation as well. Then only linework that is at an elevation is our contours. is there a way to extract the elevation from the elevation in the point database?

Link to comment
Share on other sites

what I can find is we have other routines written by other people in the past that extract the elevation from a Aecc-point that is set at a fixed elevation of 0.00 but is still extracts the elevation and displays the correct elevation. I guess what I mean is that the block is not elevated to the correct elevation in the drawing, so the program can get the elevation from the text based on that way the program would have to extract the information some other way. I was looking at the other codes and was wondering if aecelev would achive this?

Link to comment
Share on other sites

It would have been better if you had explained all this at the start, but even so, I still cannot quite follow your thought process.

 

How can the program extract any elevation when everything is at zero elevation?

 

And if the program were to extract an elevation value from text, then why would you want a program to create text when you already have it...

Link to comment
Share on other sites

Lee...I apologize for not mentioning from the start, but being a newbie I am still learning how things work. I appreciate your time on this topic.

 

This is what the other lisp routine does that I use.

 

1. activate the command

2. select point block from Node (which is set at 0.00 elevation)

3. extracts the description and elevation and places a line between the two text entities and the lend of the line is attached to the node of the point block.

 

4. What I was looking for is to extract the elevation from the point block and create a text entity on top of the point block with the decimal point at the same location of the node.

 

You have achived all this. My only problem now is that I need something just like you wrote to work on a non elevated point block. The other routine I have been using does this, but I dont need the description and the line drawn to the point but the elevation on top of the point with the decimal over the point.

Link to comment
Share on other sites

You have achived all this. My only problem now is that I need something just like you wrote to work on a non elevated point block. The other routine I have been using does this, but I dont need the description and the line drawn to the point but the elevation on top of the point with the decimal over the point.

 

I understand what you are saying, but where is the elevation data in all this, if everything is set at zero elevation?

Link to comment
Share on other sites

I am assuming it is stored in the point block some how. is aecelev a autocad variable that would extract the elevation somehow from the aecc point block?

 

Below is part of that routine that i have been working with.maybe the will help I do not know what everything it does.

 

 
(setq ent (car (entsel "\nSelect Point Block: ")))
 (setq dat (entget ent))
 (if (= (cdr (assoc 0 dat)) "AECC_POINT") ;begin if
   (progn    ;begin progn
     (setq aecelev (cadddr (assoc 11 dat))) ;extracts elevation text
     (setq attcd (rtos aecelev 2 (getvar "LUPREC")))
    ;setq elevation text to two decimal places
     (setq txt (cdr (assoc 302 dat))) ;extract point description
   )     ;end progn
 )     ;end if
 (if (= (cdr (assoc 0 dat)) "INSERT") ;begin if
   (progn    ;begin progn
     (setq att (entnext ent))
     (setq attcd (cdr (assoc 1 (entget att)))) ;extracts elevation
     (setq att2 (entnext att))
     (setq attcd2 (cdr (assoc 1 (entget att2))))
     (setq att3 (entnext att2))
     (setq txt (cdr (assoc 1 (entget att3))))
    ;extract point description
   )     ;end progn
 )     ;end if

Link to comment
Share on other sites

Do you have any idea on how this would work with the program that you wrote?

 

Does Autocad 2010 work with different point entites than 2006?

Link to comment
Share on other sites

Well, as I say, I have no experience of AECC objects, they are, I believe, objects from a different branch in the ADesk range (but I could be wrong of course).

 

But, if your elevation is stored as an attribute, I could certainly help.

 

Is there any way that you could upload a sample drawing containing the object that you wish to query?

Link to comment
Share on other sites

Lee-

 

An Aecc point has a name "AECC_POINT"

Point elevation is the z value of the group Code 11 value, as in CadPro's example code.

 

Thanks Carl,

 

Just to fill the gaps in my knowledge, what is an AECC_POINT?

Link to comment
Share on other sites

Ok, I have no way of testing this, but just going from your example:

 

(defun c:tpt (/ Make_Text pt ent)
 ;; Lee Mac  ~  17.01.10
 
 (defun Make_Text (pt val / BoxNum BoxHgt BoxWid pt1)

   (setq BoxNum (+ 0.412636   (getvar 'LUPREC))
         BoxHgt (* 0.892748   (getvar 'TEXTSIZE))
         BoxWid (* (/ 13 15.) (getvar 'TEXTSIZE)))

   (setq pt1 (polar pt (atan BoxHgt   (* BoxNum BoxWid)) 
                       (sqrt (+ (expt (* BoxNum BoxWid) 2)
                                (expt BoxHgt 2)))))
   
   (entmakex (list (cons 0   "MTEXT")
                   (cons 100 "AcDbEntity")
                   (cons 100 "AcDbMText")
                   (cons 71 3)
                   (list 10 (car pt1) (cadr pt1) (caddr pt))
                   (cons 40 (getvar 'TEXTSIZE))
                   (cons 1  (strcat "{\\fMonospac821 BT|b0|i0|c0|p49;" val "}")))))  

 (while
   (progn
     (setq pt (getpoint "\nSelect Point: "))

     (cond (  (not pt) nil)

           (  (setq ent (nentselp pt))

              (cond (  (eq "AECC_POINT" (cdr (assoc 0 (entget (car ent)))))

                       (Make_Text (trans pt 1 0)
                         (rtos (cadddr (assoc 11 (entget (car ent)))) 2 (getvar 'LUPREC))))

                    (  (and (= 4 (length ent))
                            (eq "INSERT" (cdr (assoc 0 (entget (setq ent (car (nth 3 ent)))))))
                            (= 1 (cdr (assoc 66 (entget ent)))))

                       (Make_Text (trans pt 1 0)
                         (cdr (assoc 1 (entget (entnext ent))))))

                    (t (princ "\n** Invalid Object Selected **"))))

           (t (princ "\n** No Object Found **")))))

 (princ))

Link to comment
Share on other sites

Thanks Luis - I have heard of such objects, but never experienced them, so I was a bit lost when it came to DXF codes... :geek:

 

I am not familiar with that package too...

The OP have not provided the whole scenario and try outs.

Link to comment
Share on other sites

I am not familiar with that package too...

The OP have not provided the whole scenario and try outs.

 

Indeed, I have just provided the best I can with the example posted :)

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