Jump to content

How to divide a line/polyline/3dpoly in equal no of parts using VBA


gogi07

Recommended Posts

Dear all,

 

I want to divide a polyline (LW or 3D) into equal no of parts using VBA.

Kindly note that I do not want the user to select the line to be divided..there would be many lines which are selected at runtime and each of these need to be divided in same number of parts.

An autolisp routine would also be helpful, if we can load it from VBA.

The input to the autolisp should be selection set of the polylines from VBA and output be an array of co-ordinates of the divided polylines.

 

I hope I am clear.

 

Any suggsetions on how to solve the above?

Link to comment
Share on other sites

There are a couple of options with regard to this type of task via VBA. The VBA api does not have a direct, build in procedure for this, but it can be custom built. See an excellent example for LWPoly division posted by Bryco in this thread:

http://www.theswamp.org/index.php?topic=20677.0

 

That thread also mentions Frank Oquendo's Curve.cls, which should be readily available via web search. That class hooks into the same ActiveX functionality used by Visual Lisp. Unfortunatley, there seems to be an interconnect issue behind the scenes at AutoCAD’s end – routines based on this class have problems processing more than a dozen or so polys.

 

As a side note: AutoCAD’s .Net api (VB.NET) has a lot more built functionality for these types of functions. The ‘at large’ opinion is that the time for exploring non VBA options is already upon us.

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