command _fillet using osnap

command _fillet using osnap

Anonymous
適用対象外
2,532件の閲覧回数
27件の返信
メッセージ1/28

command _fillet using osnap

Anonymous
適用対象外
Hello,
Once manual fillet command choose two entity points
may I use "_.fillet" command using osnap to set a getpoint position?

(setq ent1 (car (entsel "\nSelect Object1: ")))
(setq StartPoint_ent1 (vlax-curve-getStartPoint (vlax-ename->vla-object ent1))
(setq ent2 (car (entsel "\nSelect Object1: ")))
(setq EndPoint_ent2 (vlax-curve-getEndPoint (vlax-ename->vla-object ent2))

(setq pickset1 (ssadd))
(ssadd ent1 pickset1)
(command "ZOOM" "OBject" pickset1 "")
(command "_.fillet" (osnap StartPoint_ent1 "_nea") (osnap EndPoint_ent2 "_nea"))

I've used this before with success but, now the result is always nil




 

0 件のいいね
解決済み
2,533件の閲覧回数
27件の返信
返信 (27)
メッセージ2/28

ВeekeeCZ
Consultant
Consultant

If I comment out the ZOOM line, it works for me.

0 件のいいね
メッセージ3/28

devitg
Advisor
Advisor

 You LOST close parenthesis at 

 

(setq StartPoint_ent1 (vlax-curve-getStartPoint (vlax-ename->vla-object ent1))

and , at  

(setq EndPoint_ent2 (vlax-curve-getEndPoint (vlax-ename->vla-object ent2))

 

0 件のいいね
メッセージ4/28

Anonymous
適用対象外

Really works.

 

The problem happens when there are other objects (polylines) closest of the StartPoint_ent1 and EndPoint_ent2. So, it can use the wrong lines to fillet. How can I force "fillet" command using osnap, to use ent1 and ent2 only.

 

Please use the attached example, where fillet should happend on the white lines and not in the purple ones. 

 

Important: in the real situation the lines are at the same layer and color.

0 件のいいね
メッセージ5/28

Anonymous
適用対象外

I think that is related of the creation order of the lines, AUTOCAD uses the latest ones in the fillet command.
I've just simulate creating the purple lines first and left white ones as latest created and it works fine.
So, I need to cheat autocad to get the lines I want and not the latest ones.

 

Not sure about it anymore, probably is because the lines are near.

 

I did more tests and it seems the AUTOCAD uses the latest lines indeed.

0 件のいいね
メッセージ6/28

devitg
Advisor
Advisor

Please try it , 

 

(Setq sel1 (entsel "\nSelect Object1: "))
(setq ent1 (car sel1))
(setq pt1 (cadr sel1))
(setq pt@ent1 (vlax-curve-getclosestpointto (vlax-ename->vla-object ent1) pt1))
(Setq sel2 (entsel "\nSelect Object2: "))
(setq ent2 (car sel2))
(setq pt2 (cadr sel2))
(setq pt@ent2 (vlax-curve-getclosestpointto (vlax-ename->vla-object ent2) pt2))
(command "_.fillet" pt@ent1 pt@ent2)

0 件のいいね
メッセージ7/28

Anonymous
適用対象外

Thanks for the try but the FILLET command should happend to the smallest parts of the segmentes ent1 and ent2, that's why I am forcing to use StartPoint_ent1 and EndPoint_ent2.

0 件のいいね
メッセージ8/28

devitg
Advisor
Advisor

So , pick at the short side of the white poly . 

 

0 件のいいね
メッセージ9/28

Kent1Cooper
Consultant
Consultant
解決済み

@Anonymous wrote:

....The problem happens when there are other objects (polylines) closest of the StartPoint_ent1 and EndPoint_ent2. So, it can use the wrong lines to fillet. How can I force "fillet" command using osnap, to use ent1 and ent2 only.

....


 

I haven't tried it in FILLET, but I know in [for example] LENGTHEN this works when other things are right there and might be "seen" instead of what is wanted:

 

Instead of giving it just a point, give it a list of an entity name and a point, the same as what is returned by (entsel).

Kent Cooper, AIA
メッセージ10/28

Anonymous
適用対象外

I cannot pick a point manually.
The lisp program should do it automatically, the idea its run over on hundreds of polylines without user interference.
So, StartPoint_ent1 and EndPoint_ent2 are my "pick points".

0 件のいいね
メッセージ11/28

Moshe-A
Mentor
Mentor

@Anonymous  hi,

 

you can not relay on start point\end point of the line\polyline if it be reversed, your lisp would not work.

 

moshe

 

 

 

0 件のいいね
メッセージ12/28

Anonymous
適用対象外

Looks like a good idea!

How should be the correct syntax for that?
in other words... how can I make this list using the entities names and just one point (my choice of the pick point) for each entity?

0 件のいいね
メッセージ13/28

Anonymous
適用対象外

Well, in this case I know the order the lines were created.

0 件のいいね
メッセージ14/28

Moshe-A
Mentor
Mentor

what is the advantage of using a lisp here? you asking the user to select the 2 objects, isn't running the native fillet command enough?

 

if you are not counting on the user to pick the objects on the right spots, you could find the intersection of the 2 objects, than take the 2 close ends to the intersection (assuming the other end is far enough) and let fillet to pick the the right spot in-between - NO?

 

moshe

 

 

0 件のいいね
メッセージ15/28

ВeekeeCZ
Consultant
Consultant

Here is some example...

 

(if (setq ss (ssget))
    (command "_.FILLET" (cons (ssname ss 0) (list (trans (vlax-curve-getStartPoint (ssname ss 0)) 0 1)))
             	        (cons (ssname ss 1) (list (trans (vlax-curve-getStartPoint (ssname ss 1)) 0 1)))))
メッセージ16/28

devitg
Advisor
Advisor

There is a big difference between the post , and the task to do, also it is lack of show the real environment where the

lisp have to work . 

If the OP could show the TRUE and real  DWG , maybe it can be done. 

Maybe the HANDLE  could be use , as he say he know the order acad make the ent.

 

 

 

 

 

0 件のいいね
メッセージ17/28

devitg
Advisor
Advisor
(setq ss (ssget)

Means user input, too 

0 件のいいね
メッセージ18/28

ВeekeeCZ
Consultant
Consultant

@devitg wrote:
(setq ss (ssget)

Means user input, too 


 

Psss.. you shouldn't say it out loud. That supposed to be a little secret.

0 件のいいね
メッセージ19/28

Anonymous
適用対象外

this is a little bit funny already... 🙂

I was just trying to simplify a question... and sure I can change a user input example to something else

0 件のいいね
メッセージ20/28

Anonymous
適用対象外

 

I've tried this with no success

(command "_.fillet" (cons ent1 (list (trans (list (car StartPoint_ent1) (cadr StartPoint_ent1)) 1 0) ))
                                   (cons ent2 (list (trans (list (car EndPoint_ent2)   (cadr EndPoint_ent2)) 1 0) ))
        )

and this

(command "_.fillet" (cons ent1 (list (osnap (trans (list (car StartPoint_ent1) (cadr StartPoint_ent1)) 1 0) "nea")))
                                   (cons ent2 (list (osnap (trans (list (car EndPoint_ent2) (cadr EndPoint_ent2)) 1 0) "nea")))
       )

result is ; error: Function cancelled

0 件のいいね