Jump to content

Recommended Posts

Posted

The following code was working fine and I am not sure why it is not now. It gives an error here, I am not a VBA expert know enough to get into trouble.

 

If ThisDrawing.ActiveSpace = acModelSpace Then
Set Thespace = ThisDrawing.ModelSpace
Else: Set Thespace = ThisDrawing.PaperSpace
End If

then used by
Set arcobj = Thespace.AddArc(vertPt, cRad, endang, startang)
retval2 = arcobj.IntersectWith(oPoly, acExtendOtherEntity)

Posted

I haven't AutoCAD 2016 so I can only try and guess from my previous (bad) experiences with regard to some elements of your snippet, thus supposing/hoping there's no AutoCAD version issue

 

for instance I see that you place AddArc arguments in such an order that "endang" comes before "startang". While the AddArc method would require

RetVal = object.AddArc(Center, Radius, StartAngle, EndAngle)

Of course this could also mean nothing since what matters is the actual value of the angles, not their variable names. But this remembers me an arc object orientation issue where the online documentation says:

- "An arc is always drawn counterclockwise from the start point to the endpoint"

- "The start and end angles, in radians, defining the arc. A start angle greater than an end angle defines a counterclockwise arc"

which seems contradictory, but it's not actually since you can (carefully) manage the default orientation of the Z-axis

 

should that not help you, I could try some more help if you explained in more detail the error you're facing (which line throws it and what kind of error)

 

should yours be actually an AutoCAD 2016 issue then I couldn't help you more

Posted

Hi Rcivba run this as a sub and a error occurs

 

If ThisDrawing.ActiveSpace = acModelSpace Then
Set Thespace = ThisDrawing.ModelSpace
Else: Set Thespace = ThisDrawing.PaperSpace
End If

Posted

so it's not the arc part...

 

sorry but that "space" part runs fine in my AutoCAD 2014, and thus still can't figure out the error type and location you could experience

 

maybe it can help you to know that since I have the habit to use "Option Explicit" statement, I had to explicitly declare "Thespace" which I did as follows

Dim TheSpace As AcadBlock

Posted

Yeah it works in 2013 we jumped to 2016 hence the :o may have to rewrite into VL. Fixo you out there ?

 

Sorry will post a image of error should know better its saying something like library function not declared.

  • 4 weeks later...
Posted

I have hopefully found a solution it was pretty simple, load the dvb into VBAMAN, TOOLS, References. Untick the link to a 2013 Autocad library and resave the DVB.

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