Jump to content

Generate Bearings & Distances into table


oliver

Recommended Posts

  • Replies 75
  • Created
  • Last Reply

Top Posters In This Topic

  • Madruga_SP

    22

  • ymg3

    14

  • fixo

    9

  • alanjt

    8

Top Posters In This Topic

Posted Images

Here it is with annotations now.

 

New settings:

annotreq 1 Annotation will be azimuth - distance, side by side.

annotreq 2 Annotation will be azimuth / Distance on top of each other.

annotreq nil Or anything else than 1 or 2, there will be no annotations.

 

annoth (* txth 0.5) Heigth of Text for annotations.

 

I've also added Marko's suggestion to make sure that the wipeouts are activated.

It can also be affected by the TFRAMES toggle, you want it on otherwise the circles won't be showing.

 

Next on the agenda will be translation of Titles and Prompts, and parameters for Text Colors in the table.

 

ymg

dt.LSP

Link to comment
Share on other sites

I ask to myself "Now it's impossible the code is better"

And everytime I see your update code I got a execellent surprised!:notworthy:

 

Thank you very much!!!!!

 

parameters for Text Colors in the table.

I use just one kind of table configuration. (please see the attached file)

 

 

 

Thank in advance.

TABLE FORMAT.dwg

Edited by Madruga_SP
Link to comment
Share on other sites

There it is with an attempt at multi-language support.

 

Right now I got English, French, Portuguese, Russian for Fixo, Serbian for Marko, and Spanish.

 

I've modified the color support for the table text. However I could not come up with anything smarter than keeping the *cObj* *r* *g* and *b* global.

 

One question for the vl wiz, Do I need to release the objects since they are put to nil upon completion of the routine.

 

You start the routine by typing TD which stands for Technical Description.

 

For Madruga_SP this updates does not bring you much, it may even be a regression for you as some of the titles are different than yours.

 

I will try to address the table line colors and putting having numbers according to your format 00 - 01, 01 - 02 etc.

 

ymg

td.LSP

Link to comment
Share on other sites

Madruga_SP,

 

Here I've implemented padding for the station numbers.

 

For this there is a new setting padcar which you set to "0" for your case,

if you set padcar to """ there will be no padding. You could also use " " a space so that everything align.

 

ymg

td.LSP

Link to comment
Share on other sites

Hi ymg

How have you been?

 

Thank you very much! The code is amazing, doing everything I need.

Worked like a charm.:D

 

I've been looking for that code for a long time and you made my wish come true.:notworthy:

 

Thank you, ymg

Best Regards

Link to comment
Share on other sites

  • 2 weeks later...
Can not read if the direction are DUE EAST, DUE WEST, DUE NORTH, or DUE SOUTH.

 

It does work here, or I don't understand when youy direction are Due East.

 

Here attached a small modif. which let you vary the numbers of sides of the wipeouts,

thus you can have Triangle, Square......n-sided polygon as your wipeouts on the vertices by varying parameters woside in the setting section.

td.LSP

Link to comment
Share on other sites

  • 5 weeks later...

Thank you for replay my friend,

Your code is exactly I was wanted to.

 

But I've already did some modifications in your code and I couldn't add radius and arc distance in my code.

 

Could you help me add radius and arc distance in the code bellow, please??

 

Is it possible change the decimal separator to comma??

Because in Brazil we use comma instead of period.

 

Thank you very much, again!

td-radius.LSP

Link to comment
Share on other sites

Hi,

Sorry to bother you, my friend...

(Você está se tornando um pouco preguiçoso ...:lol:)

"Eu ainda sou iniciante em autolips, estou aprendendo..."

I'm learning about lisp, there are some tutorials in youtube (portuguese) and I'm watching.

 

Thank God there are people like you...

 

Many Thank you

:D

Link to comment
Share on other sites

  • 3 years later...
  • 2 years later...
On 6/19/2010 at 4:44 PM, fixo said:

 

Try this one (quick and dirty though)

 


(vl-load-com)
(defun C:Bearings (/ *error* acsp ang atable cnt col dist item osm
     point_list pt row table_data tmp tmp_data)

  (defun *error*  (msg)
    (if (and msg
      (not
        (member msg
         '("console break" "Function cancelled" "quit / exit abort"))))
      (princ (strcat "\nError: " msg))
      )
    (if osm
      (setvar "osmode" osm))
    (princ)
    ) 

(setq osm (getvar "osmode"))
(setvar "osmode" 1)

(setq cnt 1)
(while (setq pt (getpoint
    (strcat "\n  >> Specify point #"
     (itoa cnt)
     " by order (hit Enter to exit) >> ")))
  (setq point_list (cons pt point_list)
 cnt    (1+ cnt))
  )
(setq point_list (reverse point_list))

(setq cnt 0)
(while (<= cnt (- (length point_list) 2))
  (setq tmp  (list (strcat (itoa (1+ cnt)) " - " (itoa (+ cnt 2)))
         (nth cnt point_list)
         (nth (1+ cnt) point_list))
 tmp_data (cons tmp tmp_data)
 )
  (setq cnt (1+ cnt))
  )
(setq tmp      (list (strcat (itoa (length point_list)) " - 1")
       (last point_list)
       (car point_list))
      tmp_data (cons tmp tmp_data)
      )
(setq tmp_data (reverse tmp_data))
(foreach item  tmp_data
  (setq ang (angle (cadr item) (caddr item)))
  (setq ang (angtos ang 4 4))
  (setq dist (distance (cadr item) (caddr item)))
  (setq dist (strcat (rtos dist 2 2) " m."))
  (setq tmp (list (car item) ang dist))
  (setq table_data (cons tmp table_data))
  )
(setq table_data (reverse table_data))
(setq pt (getpoint "\n  >> Specify insertion point >> "))
(setq acsp (vla-get-block
      (vla-get-activelayout
        (vla-get-activedocument
   (vlax-get-acad-object))))
      )
(setq atable
       (vlax-invoke
  acsp
  'AddTable
  pt
  (+ 2 (length table_data))
  (length (car table_data))
  (* (getvar "textsize") 2.0)
  (* (getvar "textsize") 15))
      )
(vla-put-regeneratetablesuppressed atable :vlax-true)
(vla-settextheight atable actitlerow (getvar "textsize"))
(vla-settextheight atable acheaderrow (getvar "textsize"))
(vla-settextheight atable acdatarow (getvar "textsize"))
(vla-put-vertcellmargin atable (/ (getvar "textsize") 4.25))
(vla-settext atable 0 0 "TECHNICAL DESCRIPTIONS")
(vla-settext atable 1 0 "LINES")
(vla-settext atable 1 1 "BEARINGS")
(vla-settext atable 1 2 "DISTANCES")
(setq row 2)
(foreach item  table_data
  (setq col 0)
  (foreach x  item
    (vla-settext atable row col x)
    (vla-setcellalignment atable row col acMiddleCenter)
    (setq col (1+ col)))
  (setq row (1+ row))
  )

  (vla-put-regeneratetablesuppressed atable :vlax-false)

  (*error* nil)

  (princ)
)

 

 

 

~'J'~

Good day, ive been looking for this specific lisp for over a year already. dont know why i didnt find this sooner. Really thankful to Mr. Fixo. youre a lifesaver. 

 

I was wondering, what can i change to make in this code to make the output table looks like (attached photo) 

 

Thank you! 

received_1780596505425080.png

Link to comment
Share on other sites

If you do a bit of research about tables 

 

(+ 3 (length table_data)) will add a extra row

(vla-settext atable 1 0 "LINES")
(vla-settext atable 1 1 "BEARINGS")
(vla-settext atable 1 2 "DISTANCES")

(vla-settext atable 2 0 "LOT ACTUAL SURVEY")

 

note also need to increase start row for brg-dist

 

(setq row 2) now (setq row 3)

 

Your homework is  (vla-mergecells atable rowmin rowmax colmin colmax x))

 

A lot of us have aknowledged help from FIXO he will be missed.

Edited by BIGAL
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...