I can create " centermarks " from iLogic ?

I can create " centermarks " from iLogic ?

Anonymous
Not applicable
1,141 Views
3 Replies
Message 1 of 4

I can create " centermarks " from iLogic ?

Anonymous
Not applicable

Hello everyone!

I 'm trying to create center marks using iLogic .

I created attributes "attribute helpper " Brian Ekins

 

Image01.PNG

 

http://modthemachine.typepad.com/my_weblog/2013/08/attribute-helper-update.html

 

And then I try to use my element that attribute as input and generate the center mark .

 

Here my code:

 

 

Dim oDrawDoc As DrawingDocument
oDrawDoc = ThisDoc.Document

Dim oSheet As Sheet
oSheet = oDrawDoc.ActiveSheet

Dim oView As DrawingView
oView = ActiveSheet.View("FRONT_VIEW").View

Dim oAssyDoc As AssemblyDocument
oAssyDoc = ActiveSheet.View("FRONT_VIEW").ModelDocument

Dim oCenterMarks As CenterMarks
oCenterMarks = oSheet.CenterMarks

Dim aoEdge4 As Face
oObjs = oAssyDoc.AttributeManager.FindObjects("DIM", "FDE", "1")
aoEdge4 = oObjs.item(1)

Dim aoDrawCurves4 As DrawingCurve
oDrawViewCurves = oView.DrawingCurves(aoEdge4)
aoDrawCurves4 = oDrawViewCurves.item(1)

Dim oDim2 As CenterMarks
oDim2 = oCenterMarks.Add(oSheet.oSheet.CreateGeometryIntent(aoDrawCurves4))

 

And i have this error:

 

Image02.PNG

 

 

This is the reason why I wonder if you can use center marks in iLogic .

 

I am new to programming , to generate this code and used my logic to replace that eh caught fragments found in this forum but since it can not do.

an apology for my bad English and dialog with the error displayed in Spanish .

 

Thank you very much! Greetings to all

0 Likes
1,142 Views
3 Replies
Replies (3)
Message 2 of 4

bshbsh
Collaborator
Collaborator

Have a look at your last code line (oDim2) which has two oSheet. I guess that's what the error message says as well.

0 Likes
Message 3 of 4

Anonymous
Not applicable

Thanks bshbsh

Eliminate double " oSheet " and the center mark is created but now I get this error.

 

Error.PNG

 

In others attempts i have already receibed the error but y do not quite understad that refers to.

Any suggestions, i´m missing something?

Thanks again.

0 Likes
Message 4 of 4

Anonymous
Not applicable

After calmly review my code I realized that possibly had a letter " s " of more syntax in my code.

Delete it and no longer under more mistakes , all you notice is that the command remains active waiting terminated by right and click Cancel .

 

But I can run my following iLogic rules without any problem .

 

So they were my codes to create a line of Bisector center and center mark .

 

 

Dim oDrawDoc As DrawingDocument
oDrawDoc = ThisDoc.Document

Dim oSheet As Sheet
oSheet = oDrawDoc.ActiveSheet

Dim oView As DrawingView
oView = ActiveSheet.View("FRONT_VIEW").View

Dim oAssyDoc As AssemblyDocument
oAssyDoc = ActiveSheet.View("FRONT_VIEW").ModelDocument

Dim oCenterLines As Centerlines
oCenterLines = oSheet.Centerlines

Dim aoEdge4 As Face
oObjs = oAssyDoc.AttributeManager.FindObjects("DIM", "FCL", "1")
aoEdge4 = oObjs.item(1)

Dim aoEdge3 As Face
oObjs = oAssyDoc.AttributeManager.FindObjects("DIM", "FCR", "1")
aoEdge3 = oObjs.item(1)

Dim aoDrawCurves4 As DrawingCurve
oDrawViewCurves = oView.DrawingCurves(aoEdge4)
aoDrawCurves4 = oDrawViewCurves.item(1)

Dim aoDrawCurve3 As DrawingCurve
oDrawViewCurves = oView.DrawingCurves(aoEdge3)
aoDrawCurves3 = oDrawviewCurves.item(1)

Dim oDim2 As CenterLine
oDim2 = oCenterLines.AddBisector(oSheet.CreateGeometryIntent(aoDrawCurves3), oSheet.CreateGeometryIntent(aoDrawCurves4))

 

 

 

Dim oDrawDoc As DrawingDocument
oDrawDoc = ThisDoc.Document

Dim oSheet As Sheet
oSheet = oDrawDoc.ActiveSheet

Dim oView As DrawingView
oView = ActiveSheet.View("LEFT_VIEW").View

Dim oAssyDoc As AssemblyDocument
oAssyDoc = ActiveSheet.View("LEFT_VIEW").ModelDocument

Dim oCenterMarks As CenterMarks
oCenterMarks = oSheet.CenterMarks

Dim aoEdge4 As Face
oObjs = oAssyDoc.AttributeManager.FindObjects("DIM", "FDE", "1")
aoEdge4 = oObjs.item(1)

Dim aoDrawCurves4 As DrawingCurve
oDrawViewCurves = oView.DrawingCurves(aoEdge4)
aoDrawCurves4 = oDrawViewCurves.item(1)

Dim oDim2 As CenterMark
oDim2 = oCenterMarks.Add(oSheet.CreateGeometryIntent(aoDrawCurves4))

 

i use to eliminate the following rules

 

 

Dim oDoc As DrawingDocument
oDoc = ThisDoc.Document
Dim oSheet As Sheet
Dim oCL As Centerline


For Each oSheet In oDoc.Sheets
    oSheet.Activate

    For Each oCL In oSheet.Centerlines
        'If oCL.Attached = False
            oCL.Delete
        'End if 'Centerline attached
    Next 'Centerline
Next

Dim oDoc As Document
oDoc = ThisServer.ActiveDocument
Dim oSheet As Sheet
Dim oCM As CenterMark


For Each oSheet In oDoc.Sheets
    oSheet.Activate

    For Each oCM In oSheet.Centermarks
        'If oCL.Attached = False
            oCM.Delete
        'End if 'Centerline attached
    Next 'Centerline
Next

 

Now i'm trying to create a center line but i find that my imput objects were incorrect and that the help says something about a collection of objects. in the method that had been using the center marks or lines they were generated through GeometryIntent.

 

Someone could guide me a bit about how ObjectCollection used please?

 

Thank you very much!

 

Regards