BIGAL Posted March 29, 2010 Share Posted March 29, 2010 I am sure its a simple fix I am not sure what I am doing wrong. I have searched the forum here and looked at lots of examples which is why I can not see what is wrong. I have a line that intersects an arc, if the line is extended to meet the arc the simple lisp works if the line does not touch can not get it to work and not sure why not with extending entity. (vl-load-com) (setq obj1 (vlax-ename->vla-object (car(entsel "\nPick arc :")))) (setq obj2 (vlax-ename->vla-object (car(entsel "\nPick line :")))) (setq intpt (vlax-invoke obj1 'intersectWith obj2 1)) ; 1 is extend line acExtendthisentity ;(setq intpt (vlax-invoke obj1 'intersectWith obj2 acExtendnone)) ; 0 is acExtendnone (command "point" intpt) (princ) Quote Link to comment Share on other sites More sharing options...
jammie Posted March 29, 2010 Share Posted March 29, 2010 You are almost there, try updating (setq intpt (vlax-invoke obj1 'intersectWith obj2 1)) to (setq intpt (vlax-invoke obj2 'intersectWith obj1 acExtendThisEntity)) Quote Link to comment Share on other sites More sharing options...
BIGAL Posted March 29, 2010 Author Share Posted March 29, 2010 Found it need to use acExtendOtherEntity its always a simple answer but finding it can be hard sometimes in the help. (setq intpt (vlax-invoke obj1 'intersectWith obj2 acExtendotherEntity)) also (setq intpt (vlax-invoke obj1 'intersectWith obj2 2)) ; 2 is acExtendotherEntity ; 3 is acExtendboth Quote Link to comment Share on other sites More sharing options...
jammie Posted March 29, 2010 Share Posted March 29, 2010 Didn't think of using the acExtendOtherEntity in that context May find it useful down the line Quote Link to comment Share on other sites More sharing options...
BIGAL Posted March 29, 2010 Author Share Posted March 29, 2010 Thanks jammie getting the order of which one to extend makes the difference. Both ways work. Just a little quirk need to watch out for osnaps can over-ride answer. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted March 30, 2010 Share Posted March 30, 2010 BigAl, OSnaps won't affect the VL/Ent* methods, so I would advise to using something like: (lambda (p) (entmakex (cons 0 "POINT") (cons 10 p))) to create your point. Another helpful thread here: http://www.cadtutor.net/forum/showthread.php?t=44768 Quote Link to comment Share on other sites More sharing options...
jammie Posted March 30, 2010 Share Posted March 30, 2010 Curious, Why use lambda here? Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted March 30, 2010 Share Posted March 30, 2010 I wanted to show a general example (i.e. not make it specific to a variable), but didn't want to define a function to do it, - perhaps unnecessary, but the cat can be skinned in many ways Quote Link to comment Share on other sites More sharing options...
jammie Posted March 30, 2010 Share Posted March 30, 2010 That make sense How do you call on the expression to actually create the point? Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted March 30, 2010 Share Posted March 30, 2010 Well, it is probably not practical in this example, but: ( (lambda (p) (entmakex (cons 0 "POINT") (cons 10 p))) intpt) Quote Link to comment Share on other sites More sharing options...
jammie Posted March 30, 2010 Share Posted March 30, 2010 I was always under the impression that you could only call on lambda via one of the apply functions Learn something new everyday Thanks for that Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted March 30, 2010 Share Posted March 30, 2010 No worries mate Quote Link to comment Share on other sites More sharing options...
alanjt Posted March 30, 2010 Share Posted March 30, 2010 You are almost there, try updating (setq intpt (vlax-invoke obj1 'intersectWith obj2 1)) to (setq intpt (vlax-invoke obj2 'intersectWith obj1 acExtendThisEntity)) Just for the record: (eq acExtendThisEntity 1) => T Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted March 30, 2010 Share Posted March 30, 2010 FYI You also can check using: (eval acExtendThisEntity) Quote Link to comment Share on other sites More sharing options...
alanjt Posted March 30, 2010 Share Posted March 30, 2010 FYI You also can check using: (eval acExtendThisEntity) or !acExtendThisEntity I was trying to show that they were equal. I'm not sure why I showed it in code. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.