Author Topic: vla-put-? how do I list the options available?  (Read 5946 times)

0 Members and 1 Guest are viewing this topic.

KewlToyZ

  • Guest
vla-put-? how do I list the options available?
« on: June 25, 2008, 01:31:44 PM »
I wondered how I could get all the available options for vla-put-, vla-, etc..
Thanks in advanced  :kewl:
More or less I wanted the tree of how the formatting goes and what entities are able to be used.

T.Willey

  • Needs a day job
  • Posts: 5251
Re: vla-put-? how do I list the options available?
« Reply #1 on: June 25, 2008, 01:41:39 PM »
I use the help files.  It show almost everything.  I also use these three routines to see what I can do per object.  'dlist2' is for nested object selection.

Code: [Select]
(defun c:dlist (/ ob1)
    (setq ob1 (car (entsel "Select entity:  ")))
    (setq ob2 (vlax-ename->vla-object ob1))
    (textpage)
    (vlax-dump-object ob2 t)
    (princ)
)
(defun c:dlist2 (/ ob1)
    (setq ob1 (car (nentsel "Select entity:  ")))
    (setq ob2 (vlax-ename->vla-object ob1))
    (textpage)
    (vlax-dump-object ob2 t)
    (princ)
)
(defun Dump (VlaObject)
(vlax-dump-object VlaObject t)
)
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

KewlToyZ

  • Guest
Re: vla-put-? how do I list the options available?
« Reply #2 on: June 25, 2008, 01:52:22 PM »
Thanks Tim, Always better to learn fishing than get handed a fish, in this case thanks for the pole  :kewl:
I found what I was looking for but not sure what the format problem is with my input data.
Bouncing around wondering if it is a data type issue.

Messing with the StandardLayerSetup ;; codehimbelonga kwb@TheSwamp
Added lineweights to it:
(vla-put-lineweight oNewLayer (caddr LayerData)) ;; lineweight not LWeight or linewieght!

Is it the order I have it in?
(vla-put-linetype oNewLayer LtName)
(vla-put-color oNewLayer (caddr LayerData))
(vla-put-lineweight oNewLayer (caddr LayerData))
(vla-put-description oNewLayer (cadddr LayerData))

Then added the lineweight to the list
(list "ST00" "CONTINUOUS" 8 "0.60" "Layer Description ST00")

Tried just 0.60 & .60 with and without quotes and I get the same error:
; error: Automation Error. Invalid lineweight value
« Last Edit: June 25, 2008, 02:06:38 PM by KewlToyZ »

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: vla-put-? how do I list the options available?
« Reply #3 on: June 25, 2008, 03:00:34 PM »
You are using caddr for both:
Code: [Select]
(vla-put-color oNewLayer (caddr LayerData))
(vla-put-lineweight oNewLayer (caddr LayerData))
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: vla-put-? how do I list the options available?
« Reply #4 on: June 25, 2008, 03:02:15 PM »
nth may be slower but less confusing.  8-)
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

ronjonp

  • Needs a day job
  • Posts: 7531
Re: vla-put-? how do I list the options available?
« Reply #5 on: June 25, 2008, 03:06:29 PM »
Use 60 for your lineweight.

Change your lineweight for layer 0 and use the code below to see what values vla-put-lineweight is looking for.

(vlax-ename->vla-object (tblobjname "layer" "0"))

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: vla-put-? how do I list the options available?
« Reply #6 on: June 25, 2008, 03:23:25 PM »
For lineweight values read this:
http://www.theswamp.org/index.php?topic=22438.0
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

KewlToyZ

  • Guest
Re: vla-put-? how do I list the options available?
« Reply #7 on: June 25, 2008, 03:33:01 PM »
Thanks guys,
Ronjon that fed me a hex value: #<VLA-OBJECT IAcadLayer 0d11b864>
For 0.18mm and 60mm so it must be the formatting as well converting the data type or maybe I am just accessing it wrong.

CAB I'll look up the nth reference and give it another go too.
I had noticed that Kerry Browns caddr was written with 3 d's prior to my fiddling: :?
(vla-put-color oNewLayer (caddr LayerData))
    (vla-put-description oNewLayer (cadddr LayerData))

car the first element
cdr all but the first element
cadr the second element
caddr the third element
never saw the cadddr so it had me scratching my head, neat stuff btw.
« Last Edit: June 25, 2008, 03:39:25 PM by KewlToyZ »

ronjonp

  • Needs a day job
  • Posts: 7531
Re: vla-put-? how do I list the options available?
« Reply #8 on: June 25, 2008, 03:42:02 PM »
Thanks guys,
Ronjon that fed me a hex value: #<VLA-OBJECT IAcadLayer 0d11b864>
For 0.18mm and 60mm so it must be the formatting as well converting the data type or maybe I am just accessing it wrong.

CAB I'll look up the nth reference and give it another go too.
I had noticed that Kerry Browns caddr was written with 3 d's prior to my fiddling: :?
(vla-put-color oNewLayer (caddr LayerData))
    (vla-put-description oNewLayer (cadddr LayerData))

car the first element
cdr all but the first element
cadr the second element
caddr the third element
never saw the cadddr so it had me scratching my head, neat stuff btw.

Just use (vla-get-lineweight (vlax-ename->vla-object (tblobjname "layer" "0"))) to see only the lweight value. If you use the vlide and inspect the Vla-Object, you'll see all the other goodies :-).

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: vla-put-? how do I list the options available?
« Reply #9 on: June 25, 2008, 03:45:07 PM »
Code: [Select]
_$ (car (list "ST00" "CONTINUOUS" 8 "0.60" "Layer Description ST00"))
"ST00"
_$ (cadr (list "ST00" "CONTINUOUS" 8 "0.60" "Layer Description ST00"))
"CONTINUOUS"
_$ (caddr (list "ST00" "CONTINUOUS" 8 "0.60" "Layer Description ST00"))
8
_$ (cadddr (list "ST00" "CONTINUOUS" 8 "0.60" "Layer Description ST00"))
"0.60"
_$ (last (list "ST00" "CONTINUOUS" 8 "0.60" "Layer Description ST00"))
"Layer Description ST00"
_$
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

KewlToyZ

  • Guest
Re: vla-put-? how do I list the options available?
« Reply #10 on: June 25, 2008, 04:17:32 PM »
 :-D Too kewl, you dudes rock as usual!
I had to use 60 for .6 mm since it defaults to metric it was easy.
Thanks for the lessons and the awesome help as always guys!
Code: [Select]
  (foreach LayerData StandardLayerList
    (setq oNewLayer (vla-add iacadlayers (car LayerData))
          LtName    (cadr LayerData)
    )
    (if (not (c:AssertItem iacadlinetypes LtName))
      (vla-load iacadlinetypes ltName lineTypeFile)
    )
    (vla-put-linetype oNewLayer LtName)
    (vla-put-color oNewLayer (nth 2 LayerData))
    (vla-put-lineweight oNewLayer (nth 3 LayerData))
    (vla-put-description oNewLayer (nth 4 LayerData))
    ;(vla-put-linetype oNewLayer LtName)
    ;(vla-put-color oNewLayer (caddr LayerData))
    ;(vla-put-lineweight oNewLayer (cadddr LayerData)) ; already at the 4th level
    ;(vla-put-description oNewLayer (cddddr LayerData)) ; no 5th level go with nth
  )
  (princ)
)
« Last Edit: June 25, 2008, 04:22:52 PM by KewlToyZ »

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: vla-put-? how do I list the options available?
« Reply #11 on: June 25, 2008, 04:34:15 PM »
You can play with this too:
Code: [Select]
(setq ValuesList (list "ST00" "CONTINUOUS" 8 "60" "Layer Description ST00"))
(mapcar
  '(lambda (prop value)
     (vlax-put-property obj prop value))
   (list 'linetype 'color 'lineweight 'description)
   (cdr ValuesList)
 )
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

KewlToyZ

  • Guest
Re: vla-put-? how do I list the options available?
« Reply #12 on: June 25, 2008, 06:28:40 PM »
Quote
If you use the vlide and inspect the Vla-Object, you'll see all the other goodies.
I tried it Ronjon, I seldom use VLIDE because it doesn't have line numbers.
If I can get it to feed me syntax keywords like IntelliSense does with C# in Visual Studio I would be one seriously happy camper.
So far I tried duplicating what you described but I'm not getting anything except nil?
I know I am doing the completely wrong steps though.
Just not familiar with the stepping and other interface tidbits of the vlide, always hated the ls_ files it generated and I like my Textpad much better for text editing/searching.

Thanks CAB I was also reading here: http://www.theswamp.org/index.php?topic=19588.0
trying to find the vla-put- for (plot / no plot)
vla-put-plottable wasn't it,
; error: ActiveX Server returned an error: Parameter not optional
tried plot and noplot
Sifting through help files right now too.
Mainly I wanted to access every varation possible for the new layer management systems including noplot & reconcile as well.
« Last Edit: June 25, 2008, 06:39:40 PM by KewlToyZ »

ronjonp

  • Needs a day job
  • Posts: 7531
Re: vla-put-? how do I list the options available?
« Reply #13 on: June 25, 2008, 06:39:35 PM »
Paste this (vlax-ename->vla-object (tblobjname "layer" "0")) in the vlide, highlight it and use:

You can use this as well to output to the command line (F2):

(vlax-dump-object(vlax-ename->vla-object (tblobjname "layer" "0"))T)

« Last Edit: June 25, 2008, 06:45:39 PM by ronjonp »

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

ronjonp

  • Needs a day job
  • Posts: 7531
Re: vla-put-? how do I list the options available?
« Reply #14 on: June 25, 2008, 06:51:26 PM »
Quote
If you use the vlide and inspect the Vla-Object, you'll see all the other goodies.

...
trying to find the vla-put- for (plot / no plot)
vla-put-plottable wasn't it,
; error: ActiveX Server returned an error: Parameter not optional
tried plot and noplot
Sifting through help files right now too.
Mainly I wanted to access every varation possible for the new layer management systems including noplot & reconcile as well.

(vla-put-plottable layer :vlax-true or :vlax-false) :-)

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC