So you have lots of polylines to convert into feature lines and you don't want to see the dialog box that pops up each time, what to do? You could shoot your monitor, but you'd probably get fired. Here's a more productive method using VBA. The code below is pretty basic, it doesn't have any fancy bells and whistles though. The first part of the code has you pick the polyline you want converted. If you wanted to do 3Dpolylines, just change the AcadLWPolyline to Acad3DPolyline or you could have the code accept both types of objects, that's for another post or a chapter in a book.
Once we've got the polyline we need to make sure a site exists to put the feature line in and if one doesn't exist the code goes ahead and creates a new site called "NewSite". Now the code creates a variable to store the feature line objects in which is part of the site. The site used is the first one in the Sites list. If you wanted to get fancy you could add a prompt for the user to have the ability to select a site, but that's another post. Next the first feature line style in the drawing is used for the feature line style. Now finally the feature line is created.
The code above may be found on this page: http://style.civil3dreminders.com/programming
No comments:
Post a Comment