• This forum is the machine-generated translation of www.cad3d.it/forum1 - the Italian design community. Several terms are not translated correctly.

sendcommand e misura

  • Thread starter Thread starter tizianost
  • Start date Start date

tizianost

Guest
hello to all, I am new member of the community but already for years I solve my problems with autocad reading the forum. I have written in hope that, with your help, I can finally complete a written vba application to which I have been working for a few weeks (for pastime).

I tell you the situation:
the program performs for each selected object (before starting the application) the command "measure" by "sendcommand". (are there any other ways? )

problem 1:
every time the vba application sends the autocad "measure" command waits for the user to enter the number of items in which to divide the selected object by making the script useless...is there a way to avoid manually typing that number?

problem 2:
the command "measure" accepts the selection of objects only after the initialization of the command (if they select the object to be split and then start the command "measure" this unchecks the current selection asks me again to select an object). to this problem I can not imagine a solution except to find a script in vba that has the same function as "measure"...but I see it hard since so far I have found nothing around...you have advice? ?

Thank you.
Hi.
Titian
 
what makes the measure command is the division of an object into points and inserts in the coordinates a point or block, which is reconstructable tranqullously in vba.

selections objects, pick up size, divide and revenues coordinate. this according to me is the most correct method
 
Thanks for the answer.
My problem is to calculate the coordinates in which to insert points or blocks, I explain:

considering the line that goes from x1,y1 to x2,y2 I can calculate the function and calculate the intermediate point xm1,ym1, calculating again and get xm2,ym2 and so until I have entered a number of points...it doesn't seem to me a very professional thing... there must be a faster and cleaner way

If then I consider arches or circles or ellipses, it becomes still almost unmanageable.

Thank you.
Hi.
Titian
 
Thanks for the answer.
My problem is to calculate the coordinates in which to insert points or blocks, I explain:

considering the line that goes from x1,y1 to x2,y2 I can calculate the function and calculate the intermediate point xm1,ym1, calculating again and get xm2,ym2 and so until I have entered a number of points...it doesn't seem to me a very professional thing... there must be a faster and cleaner way

If then I consider arches or circles or ellipses, it becomes still almost unmanageable.

Thank you.
Hi.
Titian
thank you gp. that gave me support for the cyclethe solution that would do to your case is this

(defun c:msu()
(setq n (getint "put distance:"))
(setq sel (ssget))
(setq tot (sslength sel)
(setq cont 0)
(repeat)
(setq e1 (ssname sel cont))
(command "measure" e1 n)
(setq cont (1+ cont))
) ;
)

then copy and paste into autocad or also save as lsp file and upload it

then type msu and first insert the distance and then select all the entities to measure.

lines,archs,search works with everything.
 
Thank you! You've done too much!
I made a simple change (in place of getint I put getreal) and now everything is perfect!

I still enjoy your knowledge: Is there a way to explode a dotted line? Let me explain: I would like to convert the various segments that constitute a dotted line - - - - - - of simple lines.

Thanks again
Hi.
Titian
 

Forum statistics

Threads
44,997
Messages
339,767
Members
4
Latest member
ibt

Members online

No members online now.
Back
Top