Jump to content

Recommended Posts

Posted

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.

  • Replies 48
  • Created
  • Last Reply

Top Posters In This Topic

  • alanjt

    25

  • LtRimmer

    24

Posted
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" "")

Posted

I'm still getting the same error, does it matter where I add the line?

Posted
I'm still getting the same error, does it matter where I add the line?

 

Show me what you have, I'm traveling blind.

Posted

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

Posted

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

Posted

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.

Posted
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.

Posted

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:

Posted

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.

Posted

It's still the same, see attached drawing.

 

Would it be an issue with 2008, as I'm not currently at my 2009 machine.

Posted
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.

Posted

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

Posted

Very strange, I'll try it on a different machine (just in case)

Posted

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

Posted

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.

Posted
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?

Posted

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.

Posted

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

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...