LtRimmer Posted November 19, 2009 Author Posted November 19, 2009 I'm still getting the error below, it doesn't appear to be selecting the line. Command: _.pedit Select polyline or [Multiple]: Select polyline or [Multiple]: _L Enter an option [Close/Join/Width/Edit vertex/Fit/Spline/Decurve/Ltype gen/Undo]: on Invalid option keyword. Quote
alanjt Posted November 19, 2009 Posted November 19, 2009 I'm still getting the error below, it doesn't appear to be selecting the line. Command: _.pedit Select polyline or [Multiple]: Select polyline or [Multiple]: _L Enter an option [Close/Join/Width/Edit vertex/Fit/Spline/Decurve/Ltype gen/Undo]: on Invalid option keyword. Oops, forgot the "" to end the selection. (vl-cmdf "_.pedit" #Ent "" "_L" "on" "") Quote
LtRimmer Posted November 19, 2009 Author Posted November 19, 2009 I'm still getting the same error, does it matter where I add the line? Quote
alanjt Posted November 19, 2009 Posted November 19, 2009 I'm still getting the same error, does it matter where I add the line? Show me what you have, I'm traveling blind. Quote
LtRimmer Posted November 19, 2009 Author Posted November 19, 2009 Sorry, I went back to your original code just in case it was caused by the changes I made. (defun c:test (/ #Entlast #Ent #Obj #Length #LType #Value) (vl-load-com) (or (setq #Entlast (entlast)) (setq #Entlast T)) (vl-cmdf "_.pline") (while (not (zerop (getvar 'cmdactive))) (princ "\nSpecify next point: ") (vl-cmdf PAUSE) ) ;_ while (cond ((not (eq #Entlast (setq #Ent (entlast)))) (setq #Obj (vlax-ename->vla-object #Ent) #Length (vla-get-length #Obj) #LType (strcase (vla-get-linetype #Obj)) ) ;_ setq (cond ;; 4-2 ((eq #LType "4-2") (setq #Value (+ (* (fix (/ (- #Length 4) 6)) 6) 4))) ;; 1-5 ((eq #LType "1-5") (setq #Value (+ (* (fix (/ (- #Length 1) 6)) 6) 1))) ;; no match (T (alert "No matching Linetypes!")) ) ;_ cond (and #Value (vl-cmdf "_.lengthen" "_total" #Value (list #Ent (getvar 'lastpoint)) "") (princ (strcat "\nNew Length: " (vl-princ-to-string #Value))) ) ;_ and ) ) ;_ cond [b](vl-cmdf "_.pedit" #Ent "" "_L" "on" "") [/b] (princ) ) ;_ defun Quote
alanjt Posted November 19, 2009 Posted November 19, 2009 Try this: (defun c:test (/ #Entlast #Ent #Obj #Length #LType #Value) (vl-load-com) (or (setq #Entlast (entlast)) (setq #Entlast T)) (vl-cmdf "_.pline") (while (not (zerop (getvar 'cmdactive))) (princ "\nSpecify next point: ") (vl-cmdf PAUSE) ) ;_ while (cond ((not (eq #Entlast (setq #Ent (entlast)))) (setq #Obj (vlax-ename->vla-object #Ent) #Length (vla-get-length #Obj) #LType (strcase (vla-get-linetype #Obj)) ) ;_ setq (cond ;; 4-2 ((eq #LType "4-2") (setq #Value (+ (* (fix (/ (- #Length 4) 6)) 6) 4))) ;; 1-5 ((eq #LType "1-5") (setq #Value (+ (* (fix (/ (- #Length 1) 6)) 6) 1))) ;; no match (T (alert "No matching Linetypes!")) ) ;_ cond (and #Value (vl-cmdf "_.lengthen" "_total" #Value (list #Ent (getvar 'lastpoint)) "") (vl-cmdf "_.pedit" #Ent "_L" "on" "") (princ (strcat "\nNew Length: " (vl-princ-to-string #Value))) ) ;_ and ) ) ;_ cond (princ) ) ;_ defun Quote
LtRimmer Posted November 19, 2009 Author Posted November 19, 2009 Sorry to be a pain, I did try it in there and just again but I still get the same error as if nothing is selected. Quote
alanjt Posted November 19, 2009 Posted November 19, 2009 Sorry to be a pain, I did try it in there and just again but I still get the same error as if nothing is selected. Is the layer locked? It works fine on my end; no errors. Set cmdecho to 1, then try it again and paste exactly what it does. Quote
LtRimmer Posted November 19, 2009 Author Posted November 19, 2009 See below, and the layer is unlocked. Command: test _.pline Specify start point: Specify next point: Current line-width is 0.1000 Specify next point or [Arc/Halfwidth/Length/Undo/Width]: Specify next point: Specify next point or [Arc/Close/Halfwidth/Length/Undo/Width]: Specify next point: Specify next point or [Arc/Close/Halfwidth/Length/Undo/Width]: Specify next point: Specify next point or [Arc/Close/Halfwidth/Length/Undo/Width]: Specify next point: Command: _.lengthen Select an object or [DElta/Percent/Total/DYnamic]: _total Specify total length or [Angle] : 64 Select an object to change or [undo]: Select an object to change or [undo]: Command: _.pedit Select polyline or [Multiple]: Select polyline or [Multiple]: _L Enter an option [Close/Join/Width/Edit vertex/Fit/Spline/Decurve/Ltype gen/Undo]: on Invalid option keyword. Enter an option [Close/Join/Width/Edit vertex/Fit/Spline/Decurve/Ltype gen/Undo]: Command: New Length: 64 Command: Quote
alanjt Posted November 19, 2009 Posted November 19, 2009 How odd! Try this: (defun c:test (/ #Entlast #Ent #Obj #Length #LType #Value) (vl-load-com) (or (setq #Entlast (entlast)) (setq #Entlast T)) (vl-cmdf "_.pline") (while (not (zerop (getvar 'cmdactive))) (princ "\nSpecify next point: ") (vl-cmdf PAUSE) ) ;_ while (cond ((not (eq #Entlast (setq #Ent (entlast)))) (setq #Obj (vlax-ename->vla-object #Ent) #Length (vla-get-length #Obj) #LType (strcase (vla-get-linetype #Obj)) ) ;_ setq (cond ;; 4-2 ((eq #LType "4-2") (setq #Value (+ (* (fix (/ (- #Length 4) 6)) 6) 4))) ;; 1-5 ((eq #LType "1-5") (setq #Value (+ (* (fix (/ (- #Length 1) 6)) 6) 1))) ;; no match (T (alert "No matching Linetypes!")) ) ;_ cond (and #Value (vl-cmdf "_.lengthen" "_total" #Value (list #Ent (getvar 'lastpoint)) "") (vl-cmdf "_.pedit" (list #Ent (getvar 'lastpoint)) "_L" "on" "") (princ (strcat "\nNew Length: " (vl-princ-to-string #Value))) ) ;_ and ) ) ;_ cond (princ) ) ;_ defun If this doesn't work, shoot me a sample drawing. Quote
LtRimmer Posted November 19, 2009 Author Posted November 19, 2009 It's still the same, see attached drawing. Would it be an issue with 2008, as I'm not currently at my 2009 machine. Quote
alanjt Posted November 19, 2009 Posted November 19, 2009 It's still the same, see attached drawing. Would it be an issue with 2008, as I'm not currently at my 2009 machine. I seriously doubt it. Quote
alanjt Posted November 19, 2009 Posted November 19, 2009 I'm at a complete loss. Going to have to think about this one. Works fine for me. Enter new value for CMDECHO <0>: 1 Command: TEST _.pline Specify start point: Specify next point: Current line-width is 0.10 Specify next point or [Arc/Halfwidth/Length/Undo/Width]: Specify next point: Specify next point or [Arc/Close/Halfwidth/Length/Undo/Width]: Specify next point: Specify next point or [Arc/Close/Halfwidth/Length/Undo/Width]: Specify next point: Specify next point or [Arc/Close/Halfwidth/Length/Undo/Width]: Specify next point: Command: _.lengthen Select an object or [DElta/Percent/Total/DYnamic]: _total Specify total length or [Angle] <4.00)>: 4 Select an object to change or [undo]: Select an object to change or [undo]: Command: _.pedit Select polyline or [Multiple]: Enter an option [Close/Join/Width/Edit vertex/Fit/Spline/Decurve/Ltype gen/Undo]: _L Enter polyline linetype generation option [ON/OFF] <On>: on Enter an option [Close/Join/Width/Edit vertex/Fit/Spline/Decurve/Ltype gen/Undo]: Command: New Length: 4 Quote
LtRimmer Posted November 19, 2009 Author Posted November 19, 2009 Very strange, I'll try it on a different machine (just in case) Quote
alanjt Posted November 19, 2009 Posted November 19, 2009 Try this: (defun c:test (/ #Entlast #Ent #Obj #Length #LType #Value) (vl-load-com) (or (setq #Entlast (entlast)) (setq #Entlast T)) (vl-cmdf "_.pline") (while (not (zerop (getvar 'cmdactive))) (princ "\nSpecify next point: ") (vl-cmdf PAUSE) ) ;_ while (cond ((not (eq #Entlast (setq #Ent (entlast)))) (setq #Obj (vlax-ename->vla-object #Ent) #Length (vla-get-length #Obj) #LType (strcase (vla-get-linetype #Obj)) ) ;_ setq (cond ;; 4-2 ((eq #LType "4-2") (setq #Value (+ (* (fix (/ (- #Length 4) 6)) 6) 4))) ;; 1-5 ((eq #LType "1-5") (setq #Value (+ (* (fix (/ (- #Length 1) 6)) 6) 1))) ;; no match (T (alert "No matching Linetypes!")) ) ;_ cond (and #Value (vl-cmdf "_.lengthen" "_total" #Value (list #Ent (getvar 'lastpoint)) "") (princ (strcat "\nNew Length: " (vl-princ-to-string #Value))) (vl-catch-all-apply 'vla-put-linetypegeneration (list #Obj :vlax-true)) ) ;_ and ) ) ;_ cond (princ) ) ;_ defun Quote
LtRimmer Posted November 19, 2009 Author Posted November 19, 2009 Just tried it on our 2009 machine and both versions work great, however both versions do not work on the 2008 machine. I can't tell if it's the machine or 2008 as we only had one 2008 machine available today, unfortunately most of our machines run 2008. Quote
alanjt Posted November 19, 2009 Posted November 19, 2009 Just tried it on our 2009 machine and both versions work great, however both versions do not work on the 2008 machine. I can't tell if it's the machine or 2008 as we only had one 2008 machine available today, unfortunately most of our machines run 2008. You tried the version that does NOT have the pedit command? Version shouldn't matter anymore. I'm setting the linetype generation with vla. What's it doing now? Quote
LtRimmer Posted November 19, 2009 Author Posted November 19, 2009 Both version do not work on the 2008 machine, you just don't see the error message with the vla version any more. I'm currently sitting in front of both PC's if you can think of anything to try. Quote
alanjt Posted November 19, 2009 Posted November 19, 2009 Now? (defun c:test (/ #Entlast #Ent #Obj #Length #LType #Value) (vl-load-com) (or (setq #Entlast (entlast)) (setq #Entlast T)) (vl-cmdf "_.pline") (while (not (zerop (getvar 'cmdactive))) (princ "\nSpecify next point: ") (vl-cmdf PAUSE) ) ;_ while (cond ((not (eq #Entlast (setq #Ent (entlast)))) (setq #Obj (vlax-ename->vla-object #Ent) #Length (vla-get-length #Obj) #LType (strcase (vla-get-linetype #Obj)) ) ;_ setq (cond ;; 4-2 ((eq #LType "4-2") (setq #Value (+ (* (fix (/ (- #Length 4) 6)) 6) 4))) ;; 1-5 ((eq #LType "1-5") (setq #Value (+ (* (fix (/ (- #Length 1) 6)) 6) 1))) ;; no match (T (alert "No matching Linetypes!")) ) ;_ cond (and #Value (vl-cmdf "_.lengthen" "_total" #Value (list #Ent (getvar 'lastpoint)) "") (princ (strcat "\nNew Length: " (vl-princ-to-string #Value))) (vl-catch-all-apply 'vla-put-linetypegeneration (list #Obj :vlax-false)) ) ;_ and ) ) ;_ cond (princ) ) ;_ defun Quote
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.