Page 1 of 1

BUG with "(entsel)" type responses

Posted: Fri Aug 17, 2001 11:04 am
by ordiales
Hi!

When I use "trim" or "extend" sometimes it is necessary insertion of both "entity" and "point" like (entsel) does.

A Bug in intellicad doesn't allow that... and CRASH the program.

I.E.:
(command "trim" (entsel) "" (entsel) "")

I want trim a line but I want also said what side of that line I want trim.

That command may CRASH intellicad. And It doesn't work.
(but It works perfectly in Autocad)

Variants like

(command "trim" ent1 "" (list ent2 pto2) "")

doesn't works... becouse Intellicad doesn't works fine with "(entsel)" type responses like (<ent0003> (0.1000 0.43000 0.000))

Any workarround?

Posted: Fri Aug 17, 2001 11:25 am
by davep
Use entsel to pick your objects first, then mabey use getpoint to select a point. Do this before issuing the trim command. After they are chosen you may then pass the items to the trim command.

Posted: Fri Aug 17, 2001 12:45 pm
by avaernes
I think the first (entsel) is the problem. Try
(command "trim" (ssget) "" (entsel) "" )
instead.

Posted: Sat Aug 18, 2001 7:52 am
by ordiales
<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by avaernes:
<B>I think the first (entsel) is the problem. Try
(command "trim" (ssget) "" (entsel) "" )
instead.</B><HR></BLOCKQUOTE>

No, this solution also FAILs...

And I DON'T WANT LOOSE the description of the entity to be "Trimed" or "Extended" beacouse sometimes I want "trim" on lines where has intersections with other lines in the point signaled.

In Autocad responses like (<entity xxx> (0.100 0.200 0.00)) to signal and Entity and WHERE act with that entity are complete legal.

In Intellicad that kind of responses doesn't works and the program became inestable.

But sometimes there is not "alternative" to use an entity and his point together in case where more of one entity cross in the same point and you want "trim" or "extend" only one of both.

If I specify only the ENTITY that entity can be cutted from the wrong side.

If I specify only the POINT may be (it occurs in my case) that entity has other lines crossing in the same point and another entity is cutted instead.

This is a BUG to be corrected in future versions of Intellicad.

Posted: Sun Aug 19, 2001 12:08 am
by avaernes
I still do not see why you need a point description of the first object to be selected (the edge). The intersection point is, after all, not defined until you select the second object.

These lines are valid in my Intellicad version:
(command "trim" (ssget) "" (entsel) "" )
or
(command "trim" (car (entsel)) "" (entsel) "" )

When I test them in Autocad, they are NOT valid. That also includes (command "trim" (entsel) "" (entsel) "") which was your example. (Are you sure you are not missing an error prompt i Autocad).
Autocad requires (command "trim" pause "" pause "" ) to do this.

Posted: Sun Aug 19, 2001 12:43 am
by ordiales
<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by avaernes:
<B>I still do not see why you need a point description of the first object to be selected (the edge). The intersection point is, after all, not defined until you select the second object.

These lines are valid in my Intellicad version:
(command "trim" (ssget) "" (entsel) "" )
or
(command "trim" (car (entsel)) "" (entsel) "" )

When I test them in Autocad, they are NOT valid. That also includes (command "trim" (entsel) "" (entsel) "") which was your example. (Are you sure you are not missing an error prompt i Autocad).
Autocad requires (command "trim" pause "" pause "" ) to do this.</B><HR></BLOCKQUOTE>

Yes, I DON'T NEED point description on EDGE selection. But I need point and entity description in lines to be cutted.

This is the right STEPS to CRASH intellicad:

TRIM <cr>
<select 2 cutting edges>
<cr>
(entsel)
<select one line to be cutted>

Intellicad CRASH... :-(

Another example in LISP:

This works fine in AUTOCAD and it is a VERY USERFULL routine.
Intellicad CRASH beacouse (entsel) type responses fails with "TRIM"

; ****** XTRIM ****
;(c)Ramon Ordiales
(defun c:xtrim(/ ent ent2 pt1 pt2 xent)
(setq ent (entsel))
(while ent
(setq ent2 (entget (car ent))
pt1 (spunto ent2 0) pt2 (spunto ent2 1)
xent (ssget "_c" pt1 pt2)
)
(command "_trim" xent "" ent "")
(setq ent (entsel))
)
)
; ********************

Posted: Sun Aug 19, 2001 11:25 am
by avaernes
My Intellicad does not crash if I follow your steps. It does what it is supposed to do. What Intellicad version do you use?

I can't test the routine because the spunto function is not included.

Posted: Sun Aug 19, 2001 11:40 am
by ordiales
<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by avaernes:
<B>My Intellicad does not crash if I follow your steps. It does what it is supposed to do. What Intellicad version do you use?

I can't test the routine because the spunto function is not included.</B><HR></BLOCKQUOTE>


Sorry... I forgot that...

I use "CMS Intellicad 2001 Sp"

spunto:

;Saca un punto de una entidad y lo transf al ucs

(DEFUN spunto (xent xno)
(trans (sc (+ 10 xno) xent) 0 1)
)

;Saca un dato de una entidad

(DEFUN sc (xdto xent)
(cdr (assoc xdto xent))
)

Posted: Sun Aug 19, 2001 1:37 pm
by avaernes
Your routine works perfectly in my Intellicad (superb routine!!). Your spanish Intellicad version is probably compiled from an older source than my Intellicad is. You probably have to wait for the spanish version to be updated with the current source code. Apparently this is fixed in newer versions than yours.

Posted: Mon Aug 20, 2001 6:02 am
by avaernes
Correction...
It does not work properly with my CMS Intellicad either (newest source). I did my first test on a version from another vendor, where it works well. I do not understand what is happening here, because it throws the error AFTER it has completed trim operation.
I agree it is a bug.

Posted: Mon Aug 20, 2001 7:53 am
by ordiales
<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by avaernes:
<B>Correction...
It does not work properly with my CMS Intellicad either (newest source). I did my first test on a version from another vendor, where it works well. I do not understand what is happening here, because it throws the error AFTER it has completed trim operation.
I agree it is a bug.</B><HR></BLOCKQUOTE>

Thanks!!! Please, can you tell me what intellicad version are you using to test this example? What version works fine and what version doesn't?

(entsel) bug crash completly my CMS INTELLICAD and I use that kind of trick with (entsel) in several routines... :-(

Posted: Mon Aug 20, 2001 11:35 am
by avaernes
It is Bricsnet ver 2.2.0025. Except this particular problem, the CMS release is better at the moment (newer source code). Also, the Bricsnet release has a serious bug with the extend command, which you would probably find more troublesome than the problem discussed above.