Author Topic: help with coordinate table with area  (Read 868 times)

0 Members and 1 Guest are viewing this topic.

HOSNEYALAA

  • Newt
  • Posts: 53
Re: help with coordinate table with area
« Reply #30 on: September 11, 2020, 11:27:43 AM »
Block selection by fence
;;; ss (ssget "F" vlst '((0 . "INSERT") (66 . 1)))
Step01) I add inside maxp and minp and calculateIterator between line07...line11
Code - Auto/Visual Lisp: [Select]
  1.       for(elev=nil;cnt>=0;cnt=cnt-1)
  2.             bent=ssname(ss,cnt),
  3.             blk=vlax_ename2vla_object(bent),
  4.             atts=vlax.invoke(blk,read("getattributes")),
  5.             elev=foreach(atv,atts,(vla.get_tagstring(atv)=="POINT")?vla.get_textstring(atv):elev),
  6.             ptc=vlax.get(blk,read("insertionpoint")),
  7.             maxp=(maxp==nil)?ptc:(car(maxp)<car(ptc))?list(car(ptc),cadr(maxp),0.0):maxp,
  8.             maxp=(cadr(maxp)<cadr(ptc))?list(car(maxp),cadr(ptc),0.0):maxp,
  9.             minp=(minp==nil)?ptc:(car(minp)>car(ptc))?list(car(ptc),cadr(minp),0.0):minp,
  10.             minp=(cadr(minp)>cadr(ptc))?list(car(minp),cadr(ptc),0.0):minp,
  11.             tlst=cons(list(elev,rtos(car(ptc),2,acc),rtos(cadr(ptc),2,acc)),tlst);
  12.  
    --I restore to 100%Vlisp from code-source-step01. :wideeyed2:
    Step02)You will get greatEffects , If you insert Youtube/Links  inside Table.
    Step03)I compile the secondsource to
    • autoarom_jsldc11.lsp
    • autoarom_jsdup35.lsp
    Step04)I compile the mainsource to
    • MyPin-Code for Execute 6473=pp_tablegreece_jspin15.lsp
    • pp_tablegreece.lsp

I'm sorry my english is not good
If you explain on a DRAWING what you want
Do you want to merge the codes?

d2010

  • Newt
  • Posts: 77
Re: help with coordinate table with area
« Reply #31 on: September 11, 2020, 11:42:18 AM »
I'm sorry my english is not good. If you explain on a DRAWING what you want
Do you want to merge the codes?
Your Lisp is very good and work fine.
Do you want to merge the codes? No. I want, if you insert many "https://www.youtube.com/xxxxx" inside table@drawing.dwg
then you will get  great-true-Effects.
You fill the table@drawing.dwg with  *www.youtube* & own-adresses(xxxxx), I hope you will get more happy.Thanks./

« Last Edit: September 11, 2020, 12:05:24 PM by d2010 »

PM

  • Newt
  • Posts: 127
Re: help with coordinate table with area
« Reply #32 on: September 11, 2020, 12:22:03 PM »
i want when export only the coordinates on polyline vertises with the number of the attribiute block in corect order.

in tes2dwg i have the numbers 32-33-34-k40

when i pick nmber 32 the correct order is  32-33-34-k40 but the pat.lsp gives me

32-k40-33-34 because k40 touch two sides of the polyline. This is the problem . Thats why i ask to export only the coordinates of vertices and no other. if the code search to find blocks neat the polyline the coordinates never be correct.

if for a reson one block is not on the polyline by mistake this code will export wrong coordinates. It is a big risk !!!

thanks

HOSNEYALAA

  • Newt
  • Posts: 53
Re: help with coordinate table with area
« Reply #33 on: September 11, 2020, 02:36:27 PM »
I'm sorry my english is not good. If you explain on a DRAWING what you want
Do you want to merge the codes?
Your Lisp is very good and work fine.
Do you want to merge the codes? No. I want, if you insert many "https://www.youtube.com/xxxxx" inside table@drawing.dwg
then you will get  great-true-Effects.
You fill the table@drawing.dwg with  *www.youtube* & own-adresses(xxxxx), I hope you will get more happy.Thanks./



thank you so much
But I didn't write the LISP
Which was written by  Dlanor

As for your idea is beautiful

Dlanor

  • Bull Frog
  • Posts: 260
Re: help with coordinate table with area
« Reply #34 on: September 11, 2020, 02:40:11 PM »
The x and y coordinates in the table should be the vertices of the polyline, not the insertion point of the block.

The problem you were seeing was caused by the selection method and the cannoscale setting. The fence selection should pick the blocks in the correct order, but it picking up the K40 block in the wrong place and not filtering it because its insertion point is on the polyline. The quickest method to get round this is to temporarily set the cannoscale to 1:1m, make the selection then reset it. This of course all hinges on 1:1m being present as an annotative scale in all drawings.

This works well in my tests, but requires two regens of the current viewport (modelspace) which I have included. However this may slow down the lisp if you have a large drawing. The only other alternative that come immediately to mind is to make multiple selection set selections at every vertex and hope that the point in the centre of the block is found. This would require some sort of a re-write, but I have something that I may be able to adapt (when I can find it).

Attached is the revised lisp, I also found and re-corrected the problem of not starting at certain points.

 

PM

  • Newt
  • Posts: 127
Re: help with coordinate table with area
« Reply #35 on: September 11, 2020, 05:35:21 PM »
Thank you Dlanor. I test the code and i think it work fine. Thanks for your time.  :smitten:

PM

  • Newt
  • Posts: 127
Re: help with coordinate table with area
« Reply #36 on: September 12, 2020, 01:15:31 AM »
Hi Dianor one last question. I know if i want to change tab from model space to layout  use

Code - Auto/Visual Lisp: [Select]
  1.    (command "_.Tilemode" 0)
  2.  

I add this command before "Select Table Insertion Point " but the table insert in modelspace. How to change it to insert the table in layout ?

Thanks

d2010

  • Newt
  • Posts: 77
Re: help with coordinate table with area
« Reply #37 on: September 12, 2020, 05:44:23 AM »
You replace ~ (command "_.Tilemode" 0)~
with ~(setvar "tilemode" 1) or (setvar "tilemode" 0)~
When you use (command..) you check the command is active or not.

Code - Auto/Visual Lisp: [Select]
  1.    (command "_.Tilemode" 0)
  2.  

Dlanor

  • Bull Frog
  • Posts: 260
Re: help with coordinate table with area
« Reply #38 on: September 12, 2020, 08:40:27 AM »
Hi Dianor one last question. I know if i want to change tab from model space to layout  use

Code - Auto/Visual Lisp: [Select]
  1.    (command "_.Tilemode" 0)
  2.  

I add this command before "Select Table Insertion Point " but the table insert in modelspace. How to change it to insert the table in layout ?

Thanks

See amended attached lisp.

You can now start in Paperspace and it will switch to Modelspace. After entering the Table name you will be asked "Modelspace" or "Paperspace" using the dynamic prompt (default "Modelspace")

If you select "Paperspace" it will switch before asking for an insertion point. Tested and working, but haven't had time to test all cases. Everything should be reset on exit.

I will try to refine this when I have time but "She who must be obeyed" has other plans for my time this weekend, and I would rather it was  :smitten: than  :knuppel2: and :tickedoff:
 

PM

  • Newt
  • Posts: 127
Re: help with coordinate table with area
« Reply #39 on: September 12, 2020, 11:59:38 AM »
Thanks Dlanor

i add this 4  lines to change table colum width

Code - Auto/Visual Lisp: [Select]
  1.   (repeat 2
  2.     (vlax-invoke t_obj 'setrowheight row 6.0)  
  3.     (vlax-invoke t_obj 'mergecells row row 0 cols)
  4.     (setq rdat (nth (1- row) lst))
  5.     (vla-put-width t_obj 75); width of all table
  6.     (vla-setcolumnwidth t_obj 0 15); width A/A
  7.     (vla-setcolumnwidth t_obj 1 30);width X
  8.     (vla-setcolumnwidth t_obj 2 30); width Y
  9.     (vlax-invoke t_obj 'setcelltextheight row 0 2.5)
  10.     (vlax-invoke t_obj 'settext row 0 (car rdat))
  11.     (setq row (1+ row))
  12.   );end_repeat
  13.  
  14.  

I didnt change ths line and the code works.But i think this 22.5 is not nessesary

Code - Auto/Visual Lisp: [Select]
  1.         t_obj (vla-addtable spc (vlax-3d-point ipt) (1+ (length lst)) (length (car lst)) 5.0 22.5) ; all colum width 22.5
  2.  

Is important to change it or doesn't mater ?

Thanks

Dlanor

  • Bull Frog
  • Posts: 260
Re: help with coordinate table with area
« Reply #40 on: September 12, 2020, 01:17:49 PM »
It's not important if you are changing the column widths later, but something has to be there or it won't create the table and will error.