BIGAL Posted February 5, 2016 Posted February 5, 2016 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) Quote
RICVBA Posted February 5, 2016 Posted February 5, 2016 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 Quote
BIGAL Posted February 5, 2016 Author Posted February 5, 2016 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 Quote
RICVBA Posted February 5, 2016 Posted February 5, 2016 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 Quote
BIGAL Posted February 5, 2016 Author Posted February 5, 2016 Yeah it works in 2013 we jumped to 2016 hence the 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. Quote
BIGAL Posted March 4, 2016 Author Posted March 4, 2016 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. Quote
Recommended Posts
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.