Jump to content

Offsetting a Line


greneebb

Recommended Posts

Good Morning All,

 

I am used to offsetting Polyline Objects. However I would like to offset a Straight line and then use that line's properties. This is not working out.

Generally the variable that receives the offset for a polyline must be a variant type because the polyline is comprised of several objects. However I expect that when a line of AcadLine type is offseted it should produce a variable of similar type, i.e AcadLine type. If this is the case, then the general properties of a line can be accessed. I am not getting this to happen. This is my sample code.

 

Here everything works fine, except for the last line. Here is the error message it generates: Object doesn't support this property or method. 

 

Can anyone tell me if I my objective can be achieved?


 

Public Sub OffsetLine(ByRef Botline As AcadLine)

Dim BotLineOffset As Variant
Dim ItemBot As Variant
Dim ItemBotCoordinates() As Double
 
     BotLineOffset = Botline.Offset(-Offset)
     Set ItemBot = BotLineOffset(0)
    
         ItemBot.Color = acYellow
    ItemBotCoordinates = ItemTop.Coordinates
  
  
End Sub

 

Edited by greneebb
Correction
Link to comment
Share on other sites

Start and end point, Coordinates is supported property of plines.

 

Use dumpit.lsp to see properties available . There should be an equivalent in VBA.

 

;;;===================================================================; 
;;; DumpIt                                                            ; 
;;;-------------------------------------------------------------------; 
;;; Dump all methods and properties for selected objects              ; 
;;;===================================================================; 
(defun C:DumpIt ( / ent) 
  (while (setq ent (entsel)) 
    (vlax-Dump-Object 
      (vlax-Ename->Vla-Object (car ent)) 
    ) 
  ) 
  (princ) 
)

 

Edited by BIGAL
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...