Recent Posts

Pages: 1 2 3 [4] 5 6 ... 10
General discussion about BabaCAD / Re: m2p funtion as transparent funktion?
« Last post by babadmin on November 25, 2017, 08:31:39 pm »
BabaCAD already has Osnap for midpoint, for Line and Arc objects. I will just extend that for polylines. Everyone who want can put your m2p.lsp to bcad.mnu (in Support folder) to load that lisp at startup, so it will function same as a built-in command.
General discussion about BabaCAD / m2p funtion as transparent funktion?
« Last post by calubax on November 25, 2017, 01:24:28 pm »
maybe the m2p should work as a tranparent funktion after calling comands like line, polyline, circle, rectangle, insertion Block and so on. Thats how it works in Autocad - what would you think about that program scheme?
here,drawing m2ptest2.dxf
hello babadmin,
the lisp changes had that result(m2ptest1.dxf). When deleting the line there is no startpoint
left -  thats ok, but that the line automatly ends at the 0,0 point is of cause not wanted.

My version of the lisp worked fine - but the thing with that point left after erasing the line (startpoint perhaps caused from the half comand? i donīt know - it is not so good in large drawings - what is this point - at the moment there is no Point definded in the Program - what could it then be?)
(attachemts m2ptest1.dxf, m2p.lsp )
You have bug in your m2p.lsp cause your second point parameter is bad and third parameter must be "" (to specify end of command, as line command does not end until last space or enter key).

You have three parameters: (half) 0.0 0.0, but 0.0 0.0 must be enclosed in parenthesis like this '(0.0 0.0) or "0.0 0.0". Also, "line" command must have "" at the end. So, your m2p.lsp must look like this:

(Defun HALF (/ a b)
(SETQ A (GETPOINT "\nFirst Point ")
B (GETPOINT A "\nOther Point "))
(defun c:m2p (/)
(command "line" (half) '(0.0 0.0) ""))
Hello babadmin,
here with the attachment version (m2P.lsp) everything works fine.
Maybe that funktion better could be included globaly to the fetch functions that are already bulid in.
 What I have found is that if I erase the line that was created with the m2p funktion the startpoint of the line stays there (looks like a Point). This rest (that Point, startpoint) of the erased line must then separatly erased.

It can do all same in BabaCAD too. I just gave example with block insert (command "insert"), but you can use any command.
If you want use mid point for line, than put (command "line" (half) '(25 30) "") , and this will draw line with startPoint= [midpoint as output calculated from func 'half'] and lastPoint=[some point ex. 25,30], or you can put some other variable instead of exact value for second point.
Yes, this works fine! - but in Autocad this function makes it possible to make much more than  just inserting a block.

So, if for example a line, point or something future input should work with the half lisp function of cause every input (line, rectangle, circle, point, xline an so on) has to get its on Half.lsp or m2p..... much work...
Copy this to m2p.lsp file

(Defun HALF (/ a b)
(SETQ A (GETPOINT "\nFirst Point ")
B (GETPOINT A "\nOther Point "))
(defun c:m2p (/)
(command "insert" "b1" (half) 1.0 0.0))

Block named 'b1' must exists in drawing before starting command 'm2p' in BabaCAD. I've tested this lisp with success.
Hello babadmin,
I did the changes - if I want to insert a block via the half lisp ( selecting two different points for example a point of a rectangle and then another point of another rectangle the block still
inserts on the first selected point - the second point is not being asked for) - the half lisp will not jump into insertion process to takeover the calculation result.

The half lisp program should deliver the coordinats for a start point (object insertion point, line start for example.
Or did I misunderstand the Lisp function.
In Autocad something similar (m2P) makes this work.

Maybe in this could be in the following updates - if it is possible
Pages: 1 2 3 [4] 5 6 ... 10