Jump to content

How to get properies and methods


Tharwat

Recommended Posts

Hello everyone .

 

I wonder how to get the properties of Layers, Layouts , Dimension Style and document etc .... ........

which are not being available to be selected by the use of function *vlax-dump-object* or any other function .

 

My intention is to get the properties and methods that are available for such a things.

 

Thanks a lot .

 

Tharwat

Link to comment
Share on other sites

[edit]

I'm kind of surprised that you even posed this question. :?

 

In any event...

[/edit]

 

This works for any valid VLA-OBJECT:

 

(defun DUMP (arg)
 (if (= 'VLA-OBJECT (type arg))
   (progn
      (textpage)
      (vlax-dump-object arg T))
   (prompt "\n** Invalid argument ** "))
 (princ))

 

 

However, here's are some examples of Layer specific DUMP routines from my toolbox:

 

(defun c:DUMPLAY  (/ layerName)
 (if (and (setq layerName (getstring "\nEnter layer name: "))
          (tblsearch "layer" layerName))
   (DUMPLAY layerName)
   (prompt "\n** Layer does not exist ** "))
 (princ))

(defun DUMPLAY  (layerName)
 (if (tblsearch "layer" layerName)
   (progn
     (textpage)
     (vlax-dump-object
       (vla-item (vla-get-layers
                   (vla-get-activedocument (vlax-get-acad-object)))
                 layerName)
       T))
   (prompt "\n** Layer does not exist ** "))
 (princ))

Edited by BlackBox
Link to comment
Share on other sites

As Renderman correctly states, vlax-dump-object will work with any VLA-Object, whether such VLA-Object is part of the AutoCAD Object Model or otherwise.

 

For investigating objects within the hierarchy of the AutoCAD Object Model, I sometimes find it easier to use the Object Model flowchart in the ActiveX Developer Reference.

 

To access this, in the VLIDE Help Documentation, navigate to:

 

ActiveX and VBA Reference » Object Model

 

From here you can click on any object listed on the Object Model flowchart to see the properties/methods pertaining to that object, and furthermore you can quickly navigate to the documentation for each property/method.

Link to comment
Share on other sites

Lee - You'd laugh, I've even gone into VBAIDE / Visual Studio to peruse the Object Viewer if I couldn't find what I was looking for. LoL

Link to comment
Share on other sites

[edit]

I'm kind of surprised that you even posed this question. :?

 

In any event...

[/edit]

Thanks for the codes , they are very helpful .

 

ًWhy you are surprised dear Renderman ?:)

 

Thanks a lot .

Link to comment
Share on other sites

Lee - You'd laugh, I've even gone into VBAIDE / Visual Studio to peruse the Object Viewer if I couldn't find what I was looking for. LoL

 

Well, the VS Object Browser would probably be best for objects outside of the AutoCAD Object Model, so you're not going too far wrong :thumbsup:

Link to comment
Share on other sites

To access this, in the VLIDE Help Documentation, navigate to:

 

ActiveX and VBA Reference » Object Model

 

.

 

That's what I knew but did not know how to get Vla-object of it to extract its Props and Methods as well .

 

And what about dims and groups and viewports etc......

 

Thanks

Link to comment
Share on other sites

That's what I knew but did not know how to get Vla-object of it to extract its Props and Methods as well .

 

Click on the item on the chart.

 

And what about dims and groups and viewports etc......

 

Every object in the model is listed.

Link to comment
Share on other sites

If I'm totally off topic then I apologize. But I've had a similar "problem" previously. Tim Willey put me onto the TblInf32.DLL file. You'll need to load it through the vlax-import-type-library function and then you can see what's in it by downloading this help file: http://support.microsoft.com/kb/q224331/

 

That way you're able to get all the properties / methods into a list so you can place them (say) in a dialog box. That's actually what the Object Browser in VBA itself uses.

Link to comment
Share on other sites

If I'm totally off topic then I apologize. But I've had a similar "problem" previously. Tim Willey put me onto the TblInf32.DLL file.

 

Running with that theme, this is a very interesting investigation into the Properties and Methods of the tool used to expose the Properties and Methods of other objects (TlbInf32.dll). As Michael states in that thread, it does have a sense of beauty in recursiveness of the statement.

Link to comment
Share on other sites

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