Jump to content

Pline and LWpline text placement


FELIX

Recommended Posts

I have a drawing in Map 3D with entities associated to object data (attributes). I have added text labels associated to each entity by querying the information from the object data. The issue I have is the placement of these text objects associated to polyline and/or LW polyline entities. Specifically, when the polyline/lw polyine is curved. Instead of the text being adjacent to the line on the polyline, it is placed in the center of the entities, which could be way off.

 

I want to create a VBA script that will spin through all the polyline and lw polylines in a drawing and modify the text insertion point so that it will be placed on the midpoint of one of the line in the polyline. Preferably the line chosen will be the line that's either teh longest line segment of the polyline or the middle most line segment of the polyline.

 

Once the insertion points of the polylines/lw polylines are modified, I plan to run the query again to relabel the polyline objects.

 

I haven't been successful at finding anything close to what I want to do. Any help would be appreciated. I am new to AutoCAD and new to VBA.

Link to comment
Share on other sites

Check out here for "draw point along polyline" this puts a point a given distance along a pline, change it to put text instead. (last couple of days)

 

If your plines are reasonably straight then when you pick the pline this could be used for the distance along the pline else you could do mid etc. You just get the distance of the pline start point with the pick point.

Link to comment
Share on other sites

Thanks, BIGAL. Unfortunately, I'd like to do this in VBA. Not too familiar with Lisp. 2nd, I would like to automate the placement of the text without any user input. Basically, I'd like to spin through all the polylines (pline or lwpline) within the drawing and change their text insertion point.

Appreciate your advice.

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