Author Topic: VLIDE Error report: Not a string inthe list: <point>  (Read 1725 times)

0 Members and 1 Guest are viewing this topic.

Daniel J. Ellis

  • Swamp Rat
  • Posts: 811
VLIDE Error report: Not a string inthe list: <point>
« on: January 06, 2011, 08:56:34 AM »
Lee's tutorial has inspied me to try debugging my latest routine in VLIDE.

The error it's returning is "Not a string in the List: <point>" and I've been able to narrow it down to the following snippet:

Code: [Select]
(DEFUN CreateOffsetBoundary( hpt / hptx hpty hptx2 hpty2 hpt2 obj  )
;RECEIVES A POINT AS AN ARGUMENT, CREATES A BOUNDARY AROUND THAT POINT AND OFFSETS THAT BOUNDARY
(SETQ
hptx (CAR hpt);GET x VALUE
hpty (CADR hpt);GET y VALUE
hptx2 (+ hptx 1000);CREATE NEW x VALUE
hpty2 (+ hpty 1000);CREATE NEW y VALUE
hpt2 (LIST hptx2 hpty2);COMBINE x AND y VALUES TO SPECIFY NEW POINT
);SETQ

(COMMAND "._BOUNDARY" hpt "")
(SETQ obj (ENTLAST))
(COMMAND "OFFSET" "0.1" obj hpt2 "")
);DEFUN

Any clues?  Google and teh search here throw up blanks :(

dJE
===
dJE

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: VLIDE Error report: Not a string inthe list: <point>
« Reply #1 on: January 06, 2011, 09:06:00 AM »

which line does it stop at ?

If you load the code into the VLIDE, set menu dropdown Debug->BreakOnError to ON (ticked) then load the code from the VLIDE into Autocad.
When the code stops with an error select Debug->LastBreakSource or Ctrl-F9 to display the line the error is on.


kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

kpblc

  • Bull Frog
  • Posts: 396
Re: VLIDE Error report: Not a string inthe list: <point>
« Reply #2 on: January 06, 2011, 09:13:53 AM »
Try this:
Code: [Select]
(defun createoffsetboundary2 (pt / )
  (if (and pt (listp pt) (>= (length pt) 2) (vl-cmdf "_.boundary" "_none" pt ""))
    (command "_.offset" 0.1 (entlast) "_none" (list (+ (car pt) 1000.) (+ (cadr pt) 1000.)) "")
    ) ;_ end of if
  ) ;_ end of defun
---
Another way:
Code: [Select]
(vl-load-com)

(defun createoffsetboundary3 (pt / minp maxp)
  (if (and pt (listp pt) (>= (length pt) 2) (vl-cmdf "_.boundary" "_none" pt ""))
    (progn
      (vla-getboundingbox (vlax-ename->vla-object (entlast)) 'minp 'maxp)
      (setq maxp (vlax-safearray->list maxp))
      (command "_.offset" 0.1 (entlast) "_none" (list (+ (car maxp) 1000.) (+ (cadr maxp) 1000.)) "")
      ) ;_ end of progn
    ) ;_ end of if
  ) ;_ end of defun
« Last Edit: January 06, 2011, 09:17:27 AM by kpblc »
Sorry for my English.

Daniel J. Ellis

  • Swamp Rat
  • Posts: 811
Re: VLIDE Error report: Not a string inthe list: <point>
« Reply #3 on: January 06, 2011, 01:01:28 PM »

which line does it stop at ?

If you load the code into the VLIDE, set menu dropdown Debug->BreakOnError to ON (ticked) then load the code from the VLIDE into Autocad.
When the code stops with an error select Debug->LastBreakSource or Ctrl-F9 to display the line the error is on.




Doing this moves the cursor to the end of the offset line.  Is it for some reason not recognising the calculated point as a point?

dJE
===
dJE

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: VLIDE Error report: Not a string inthe list: <point>
« Reply #4 on: January 06, 2011, 05:04:24 PM »
I've just tested your code and it works without error for me.

I'd suggest you may have an invalid obj


try this, one statement at a time from the VLIDE by highlighting the statement and selecting "Load Selection" icon on the Vlide toolbar.

Code: [Select]
[color=green];; createoffsetboundary_inLine.lsp[/color]
    (setq hpt (getpoint [color=Maroon]"Select Point inside boundary"[/color]))
          
    (setq hptx  (car hpt)                                  
          hpty  (cadr hpt)                                  
          hptx2 (+ hptx 1000)                              
          hpty2 (+ hpty 1000)                              
          hpt2  (list hptx2 hpty2)                          
    )
          
    (command [color=Maroon]"._-BOUNDARY"[/color] hpt [color=Maroon]""[/color])
          
    (setq obj (entlast))
          
    (command [color=Maroon]"OFFSET"[/color] 10.0 obj hpt2 [color=Maroon]""[/color])
« Last Edit: January 06, 2011, 05:15:34 PM by Kerry »
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Daniel J. Ellis

  • Swamp Rat
  • Posts: 811
Re: VLIDE Error report: Not a string inthe list: <point>
« Reply #5 on: January 11, 2011, 08:53:22 AM »
When I actually ran the routine properly, rather than trying through the VLIDE, it turns out that the error wasn't in that section of routine at all <grr>

I've been using R2011, which has a wonderful feature as part of its hatch routine to specify the layer the hatch's going to be inserted on.

This is great, until you have a routine that sets the current to where you want the hatch to go to and freezes off the random layer you had been hatching on!

I'm the only one in the office using R2011 (everyone else uses R2010) so I'm going to have to start a new thread about detecting what version of ACADwin's being run ^_^

Thanks for your help, nevertheless :)
dJE
===
dJE