Author Topic: Unable to view drawing in Layout  (Read 7435 times)

0 Members and 1 Guest are viewing this topic.

Proctor

  • Guest
Re: Unable to view drawing in Layout
« Reply #15 on: May 19, 2008, 02:33:27 PM »
Hi Kerry: I've been struggling w/ this same issue all morning and still getting nowhere.

I don't belive that VB requires parameters be typed; however, I tried placing in the type as well and it didn't make any difference:

from this:
Code: [Select]

Public Shared Sub OffsetMyPoly_2Row(ByVal pEstimatePolyId, ByVal dDouble)

to this:
Code: [Select]
Public Shared Sub OffsetMyPoly_2Row(ByVal pEstimatePolyId As DatabaseServices.ObjectId, ByVal dDouble As Double)

Here's the import statements I'm using for this page:

Code: [Select]
Imports System
Imports System.Data
Imports System.Data.OleDb
Imports Autodesk.AutoCAD.Runtime
Imports Autodesk.AutoCAD
Imports Microsoft.VisualBasic
Imports Autodesk.AutoCAD.ApplicationServices
Imports Autodesk.AutoCAD.DatabaseServices
Imports Autodesk.AutoCAD.Geometry
Imports Autodesk.AutoCAD.EditorInput
Imports Autodesk.AutoCAD.Runtime.Interop
Imports System.Drawing
Imports Autodesk.AutoCAD.Colors
Imports System.Math
Imports System.Object
Imports System.Runtime.InteropServices.Marshal
Imports System.Drawing.Imaging
Imports System.Runtime.InteropServices


When I rem out the line below:
' btr.AppendEntity(newPl)

It won't let me run this line - and it's the line I get the einvalid input. :
Dim pt As Point3d = newPl.GetPointAtDist((12 / num) * z)

When i look at it using the local variables window you showed me I see the the new poly has no objectid.
Why is it that I can get the length of the new poly...but i can get point at distance?
It seems that I have to append it to the database in order to use this method....

However, if i do that...but not this line:
  'trans.AddNewlyCreatedDBObject(newPl1, True)
it won't let me open the layout tab.

I sure appreciate all the help you've been giving me. I'm really stuck...I appreciate any ideas you can spare.

Thanks again,
Proctor








Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Unable to view drawing in Layout
« Reply #16 on: May 19, 2008, 03:59:09 PM »

I'm running out the door to catch a train ... I'll have a look tonight If I can make the time.

kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Proctor

  • Guest
Re: Unable to view drawing in Layout
« Reply #17 on: May 19, 2008, 05:38:28 PM »
ok...thank you very much!!!

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Unable to view drawing in Layout
« Reply #18 on: May 21, 2008, 05:01:02 AM »
What Acad API version are you using. ?
I recall that there was a  bug in either the GetPointAtDist or GetParameterAtDistance methods .. I'll need to check to make sure ..  I think it was GetParameterAtDistance in one of the API releases.


kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Proctor

  • Guest
Re: Unable to view drawing in Layout
« Reply #19 on: May 21, 2008, 10:29:47 AM »
Hi Kerry: I'm working w/ autoCad 2008.

Proctor

  • Guest
Re: Unable to view drawing in Layout
« Reply #20 on: May 26, 2008, 03:24:42 PM »
Hi Kerry: I just wanted to write to tell you that I ended up writing someone at autodesk to see if this was in fact an AutoCad bug and here's what they told me:

Some operations require an entity to be database resident to work. It looks like this is one. You could use the AcGe classes instead if you’re just calculating geometry, or you could add the entity to the database and transaction, make your calculation, then abort the transaction to remove the entity from the database. (You can use nested transactions if you need to).

I don't know what the AcGe classes are that he's refferring to....I tried to find them in the object browser w/ no success.

I tried aborting the transaction but it didn't seem to like that...

I finally ended up making the polyline invisible and I can now open my layouts and don't see the polyline.

Thanks again for all your help.

Proctor


Glenn R

  • Guest
Re: Unable to view drawing in Layout
« Reply #21 on: May 26, 2008, 03:30:56 PM »
AcGe is the prefix for the ARX geometry classes...look up geometry in the acad .net reference (which wraps the AcGe* ARX classes).

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Unable to view drawing in Layout
« Reply #22 on: May 26, 2008, 03:37:55 PM »

yep, you have the reference ..

Imports Autodesk.AutoCAD.Geometry
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Proctor

  • Guest
Re: Unable to view drawing in Layout
« Reply #23 on: May 26, 2008, 04:35:06 PM »
oh...ok... thank you for clarifying for me.

Proctor