Jump to content

Match linetype


wbluem88

Recommended Posts

I'm working on a VBA that can match the linetype from one line to another. Ideally the program should prompt for the line to copy the linetype from, then prompt for the line to be updated. I've tried a couple routes but I'm having issues because the linetype for all the lines is "ByLayer". When lines are on different layers with different linetypes, the "ByLayer" doesn't exactly accomplish what I want it to... any thoughts?

 

Public Sub Chgltype()
Dim objBlock1 As AcadObject
Dim objBlock2 As AcadObject
Dim strLayer As String
Dim varPoint As Variant
ThisDrawing.Utility.GetEntity objBlock1, varPoint, vbCr & "Select line to copy linetype from: "
ThisDrawing.Utility.GetEntity objBlock2, varPoint, vbCr & "Select line to be changed: "
objBlock2.Linetype = objBlock1.Linetype
End Sub

Link to comment
Share on other sites

I'm not making the call on the danger level, I'm just coding haha. I basically just need to be able to read what linetype a certain line is. It's almost always going to be ByLayer, so I probably need to identify what the linetype for that layer is. Right now the best idea I have is to code in the default linetype for all the layers, but I'm sure there's a better way.

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