jimpcfd Posted August 26, 2010 Share Posted August 26, 2010 Hi can anyone help i have a lisp file which has always worked in R14 but does not work in 2010. the purpose of the routine is to create a cap or caps in a line or arc or circle with a given width, it will prompt you to select line , arcs or circles it then will prompt for how many gaps (bridges) then for the size of the caps (bridges). as i say it has and still does work in R14. attached is the lisp file. thanks jimpcfd P$BRIDGE.LSP Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted August 26, 2010 Share Posted August 26, 2010 At first glance, the variable 'pv$message' is undefined. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted August 26, 2010 Share Posted August 26, 2010 (edited) In any case, it looks something like a program I wrote a while back: (defun c:Segs ( / *error* doc ss undo ) ;; © Lee Mac 2010 (vl-load-com) (defun *error* ( msg ) (and undo (vla-EndUndomark doc)) (or (wcmatch (strcase msg) "*BREAK,*CANCEL*,*EXIT*") (princ (strcat "\n** Error: " msg " **"))) (princ) ) (setq doc (vla-get-ActiveDocument (vlax-get-acad-object)) *segs (cond ( *segs ) ( 10 ))) (if (and (setq ss (ssget "_:L" '((0 . "ARC,CIRCLE,*POLYLINE,SPLINE,LINE,ELLIPSE")))) (progn (initget 6) (setq *segs (cond ((getint (strcat "\nSpecify Number of Segments <" (itoa *segs) "> : "))) ( *segs ))) ) ) ( (lambda ( j / ent inc i pts ) (setq undo (not (vla-StartUndoMark doc))) (while (setq ent (ssname ss (setq j (1+ j)))) ( (lambda ( inc i / pts ) (repeat (1+ *segs) (setq pts (cons (trans (vlax-curve-getPointatDist ent (* (setq i (1+ i)) inc)) 0 ent) pts)) ) (if (entmake (append (list (cons 0 "LWPOLYLINE") (cons 100 "AcDbEntity") (cons 100 "AcDbPolyline") (cons 90 (length pts)) (cons 38 (caddar pts)) (cons 70 0)) (vl-remove 'nil (mapcar '(lambda ( d ) (assoc d (entget ent))) '(6 8 39 48 210)) ) (mapcar (function (lambda ( a ) (cons 10 a))) pts))) (entdel ent) ) ) (/ (vlax-curve-getDistatParam ent (vlax-curve-getEndParam ent)) (float *segs)) -1 ) ) (setq undo (vla-EndUndoMark doc)) ) -1 ) ) (princ) ) Updated for UCS/Views. Edited August 26, 2010 by Lee Mac Quote Link to comment Share on other sites More sharing options...
Tharwat Posted August 26, 2010 Share Posted August 26, 2010 Hi can anyone help i have a lisp file which has always worked in R14 but does not work in 2010.the purpose of the routine is to create a cap or caps in a line or arc or circle with a given width, it will prompt you to select line , arcs or circles it then will prompt for how many gaps (bridges) then for the size of the caps (bridges). as i say it has and still does work in R14. attached is the lisp file. thanks jimpcfd Actually the routine return an error , and I guess the use of (setq numbridge (getint (nth 26 [b][color="red"]pv$message[/color][/b]))) is the main issue , because the pv$message is not defined in the routine . Regards, Quote Link to comment Share on other sites More sharing options...
Tharwat Posted August 26, 2010 Share Posted August 26, 2010 I am sorry , also one more thing. It is better to standard the command while using it for all versions of Autocad . (command "[b][color="red"]_.[/color][/b]break" pt2 pt1) Good luck. Quote Link to comment Share on other sites More sharing options...
jimpcfd Posted August 26, 2010 Author Share Posted August 26, 2010 hi tharwat313 the pv$message are being called from acaddoc file, all messages are call that way with the lisp files we have. i will try the changing the break command to (command "_.break" pt2 pt1) and see whether that makes a difference . hi Lee, the P$bridge routine was done way back in 1987 when we were running R10, the company we brought all our system from went broke many years ago, so it's be very hard for us to update our lisp file, i have being trying to learn autolisp i have managed to write some very simply ones but this is beyond me. if it's ok with you i will copy & paste your one and have a play. cheers jimpcfd Quote Link to comment Share on other sites More sharing options...
Tharwat Posted August 26, 2010 Share Posted August 26, 2010 What kind of error you receive when you invoke the routine ? Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted August 26, 2010 Share Posted August 26, 2010 if it's ok with you i will copy & paste your one and have a play. Certainly Jim, go ahead. I would ask however that you mark/initial any modifications to the code, as for obvious reasons, if code is posted with incorrect unmarked modifications these can reflect directly on the reputation of the original author. If you have any questions about the code, just ask. Lee Quote Link to comment Share on other sites More sharing options...
jimpcfd Posted August 26, 2010 Author Share Posted August 26, 2010 many thanks lee. hi tharwat313 what happening is, once i select some lines press enter then prompted for number of bridges (say 3) press enter the prompted for size of bridges (say 5mm) press enter , what happens is the bridge don't divide up they are irregular and the gap (bridge ) will be all different sizes. hope this makes sence. cheers jimpcfd Quote Link to comment Share on other sites More sharing options...
fixo Posted August 26, 2010 Share Posted August 26, 2010 I have changed your file slightly, seems to be working on my machine Just uncomment the lines to define number of bridges and width, as you said, these values were stored in the lsit in acaddoc.lsp And use *vl-cmdf* instead of *command* in this case ~'J'~ P$BRIDGE.LSP Quote Link to comment Share on other sites More sharing options...
jimpcfd Posted August 26, 2010 Author Share Posted August 26, 2010 thanks fixo, i noticed that you changed break command to "_.break" pt2 pt1" , what does _.break do that "break" doesn't ? cheers Quote Link to comment Share on other sites More sharing options...
jimpcfd Posted August 26, 2010 Author Share Posted August 26, 2010 thanks fixo will try that out, why does "._break" work differently form "break" ? cheers jimpcfd Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted August 26, 2010 Share Posted August 26, 2010 thanks fixowill try that out, why does "._break" work differently form "break" ? cheers jimpcfd http://www.cadforum.cz/cadforum_en/qaID.asp?tip=2425 Was 'segs' on the right lines at all? Quote Link to comment Share on other sites More sharing options...
fixo Posted August 26, 2010 Share Posted August 26, 2010 thanks fixowill try that out, why does "._break" work differently form "break" ? cheers jimpcfd That means that code will works also with english and local Acad versions ~'J'~ Quote Link to comment Share on other sites More sharing options...
jimpcfd Posted August 27, 2010 Author Share Posted August 27, 2010 Hi Lee tried segs works well, i would need to modify it to get it to do the same as our bridge routine. not sure i would now where to start with that one, any tips would be great. cheers jimpcfd Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted August 27, 2010 Share Posted August 27, 2010 Hi Lee tried segs works well, i would need to modify it to get it to do the same as our bridge routine. not sure i would now where to start with that one, any tips would be great. cheers jimpcfd Haven't looked properly at the bridge routine, but will take a look momentarily. 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.