Jump to content

Recommended Posts

Posted

I like to answer the questions here more than I like to ask them, but Im trying to accomplish something that VBA has no functionality for.

 

The end result of what i want to do is to format up the section views made from the Section manager. While it does a nice job of generating the true geometry in the section, Im constantly reformatting the lines, hatches, layers, etc to company standards - partially because there arent enough parameters in the section manager, and partially because of a bug in the section manager since AC07 that returns the wrong layers/hatches.

 

In order to automate the process in VBA, I need to get access to the geometry that (used to) make up the boundary of the hatches. I say USED TO because a bug in acad leaves the boundary geometry unassociated. This functionality is not available thru VBA, but Ive seen code (hatchb.lsp) that recreates the geometry.

 

I can barely stumble thru a "Hello world" in lisp, but am completely at home in VBA - which is good, because there is a lot that I still have to do with the hatch boundaries once I get them (and theres a lot that hatchb.lsp does that I have no use for)

 

What Im hoping to accomplish is have a piece of the hatchb.lsp, or better yet, vlisp that can be called thru VBA using a port of the VLAX.cls module, that will simply return an array of the entities, or even just the type of entities needed, to recreate the hatch boundaries. In my mind, I see a routine something in the order of passing a single hatch handle or object from VBA to the lisp, and having it return a safearray (or similar) either in memory, xdata, USER variables, *somewhere* that VBA can get at.

 

Ill do the rest - get the user input for a selected block, tunnel into the block to get all the geometry, find the hatches, call the lisp routine X amount of times for each hatch, and, upon the return of each call, find the original "dead" geometry that used to be the boundary, erase it, recreate new closed polyline boundaries, recreate a new hatch to associate with it, match the properties of the existing hatch, erase the old hatch, and then, when all the hatch work is done, go about finally formatting the geometry that is there.

 

For what its worth, the sections i generate are orthagonal views of rectangular architectural stuff, maybe a rare outside arc - but no ellipses or splines. Possibly a bolt hole or two for an inner boundary.

 

I asked about the possibilty of VLisp because that would allow 'standalone' VBA modules that others can drop into their own project, and finally give VBA users a functionality that they've never had.

 

This aint my homework, guys, and while the end result will be used here in work, it will be written parametrically enuff that others will benefit from it.

 

Any takers?

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