×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Create Dimensions in isometric view through macro.

Create Dimensions in isometric view through macro.

Create Dimensions in isometric view through macro.

(OP)
Hi Guys,

Newbie here...

I'm trying to create dimensions of a tube in isometric view.

Can somebody guide me on the same.


Regards,
Maddy

RE: Create Dimensions in isometric view through macro.

(OP)
Hi,

First of all, thanks for reply,

I'm trying to create the dimensions in drafting workbench using catscript.
Could you please guide me on this.

I've been through the documentation part to get the references but no use as of now.

Basically the idea is to create dimensions and annotations on tube in isometric view of drafting workbench.
If the tube has got bend at certain point then the dimension should be shown till the corner point(bend radius) and so on.

Please refer the attachment.

Regards,
Maddy

RE: Create Dimensions in isometric view through macro.

Hi,

Is not so easy, drafting workbench is not so friendly....bellow is just an example of a dimension between two points (created also in macro in drafting workbench). You will need to create intersection points, a.s.o....or create them in 3D and project them in 2D...

CODE --> CATScript

ub CATMain()

Set DrwDocument = CATIA.ActiveDocument
  Set DrwSheets   = DrwDocument.Sheets
  Set Selection   = DrwDocument.Selection
  Set DrwSheet    = DrwSheets.ActiveSheet
  Set DrwView     = DrwSheet.Views.ActiveView
  Set DrwTexts    = DrwView.Texts
  Set Fact        = DrwView.Factory2D
  Set GeomElems   = DrwView.GeometricElements

Dim MyView As DrawingView
 Set MyView = DrwSheet.Views.ActiveView
 Dim Fact2D  As Factory2D
 Set Fact2D = MyView.Factory2D
 Dim Point1 As Point2D
 Dim Point2 As Point2D
 Set Point1 = Fact2D.CreatePoint(80, 30)
 Set Point2 = Fact2D.CreatePoint(25, 30)
 Dim iType As catDimType
 iType = catDimDistance
 Dim myElements(1)
 myElements(1) = Array(Point1,Point2)
 Dim selpoints(3)
 selpoints(3) = Array(0, 0, 0, 0)
 Dim MyDimension1 As DrawingDimension
 Set MyDimension1 = MyView.Dimensions.Add2(iType, myElements(1), selpoints(3), Line2, 0)
 
 
 End Sub 

Regards
Fernando

https://picasaweb.google.com/102257836106335725208
https://picasaweb.google.com/103462806772634246699...

RE: Create Dimensions in isometric view through macro.

(OP)
Hi,

Thanks for your kind suggestion.

This is what i'm trying to do but as of now i'm unable to get the point details of a tube.
Manually,In tubing, first we create a run through different points selected interactively.
Next, we place a tube part using the start or end point of tube.
Meanwhile bend will be created where the run takes a turn using bend radius defined (default).

This is what i'm interested about.
1. Start Point and
2. End Point Details
3. Point detail where run has taken bend and bend angle - so that i can take a projection of all these in 2D.

In documentation its been mentioned that through run we can get the nodes details using getpoint, bendangle, bend radius. where as using so i've been getting errors for getpoint (Err = Type Mismatch error).
******************************************************
GetPoint( Move iRelAxis, CATSafeArrayVariant ioNodeLocation)

Returns the location of the current ArrangementNode.
Parameters: iRelAxis -> The relative axis to be considered when calculating the coordinate.
ioNodeLocation -> The location of the ArrangementNode.
Example:
This example retrieves the location of the ArrangementNode object objNode1.
Dim dblCoords(3) As Double
Dim iRelAxis As Move
'Fetch iRelAxis from the object containing the node
...

objNode1.GetPoint(iRelAxis, dblCoords)
***************************************************
Kindly let me know do I need to get the axis system of which object (bit confused though in this case).

Please find the attached images and files(V5 R21) for your reference.

Your kind suggestion will be highly appreciated.

Regards,
Maddy

RE: Create Dimensions in isometric view through macro.

(OP)
Hi Fernando,

I'm able to get the point details from the tubing part.

Could you please guide me on how to go about representing these 3D points in isometric manner like the one in the image attached earlier.

How to calculate the angles and positions of those points, so that the they are in proper positions.

Regards,
Maddy

RE: Create Dimensions in isometric view through macro.

(OP)
Hi,

Thanks again, will attach R18 files in few hours.

Regards,
Maddy

RE: Create Dimensions in isometric view through macro.

Hi Maddy,

I am also getting same error when try to use getpoint (Err = Type Mismatch error).

Can you please provide solution if you have? Thanks in advance

Regards,
Foster

RE: Create Dimensions in isometric view through macro.

(OP)
Simple Pass the relative RootProduct's Move.

Set iRelAxis = oDocument.Product.Move

Regards,
Maddy

The willingness to share knowledge does not make one charitable; it makes one self-reliant to know more.
Modified - Courtesy of Robert Brault

RE: Create Dimensions in isometric view through macro.

Thanks. I had did same but it was giving same error. After your reply I tried again and found same problem so I debug it more and found this solution. I have removed type declaration of point coordinate array. Instead of Dim oPtCoord(3) as Double I put only Dim oPtCoord(3). Thanks again.

Regards,
Foster

RE: Create Dimensions in isometric view through macro.

(OP)
But for me it was working...
Anyway i'll keep a note on that.

Regards,
Maddy

The willingness to share knowledge does not make one charitable; it makes one self-reliant to know more.
Modified - Courtesy of Robert Brault

RE: Create Dimensions in isometric view through macro.

Helau Senor Fredo, helau - helau, I am back in business !

"Is not so easy, drafting workbench is not so friendly" big smile hey-hey, get rid of the computer, close Catia ... take a pen, a paper and remember Analytical Geometry from 9-th class

how I can understand from the posts above, the problem is planar
we have 2 segments defined by
1) y=a1*x+b1 (where a1 and b1 are the "angle with x axis" and "free member" or "the intersection with y axis")
2) y=a2*x+b2

The intersection point (of the lines which support these segments) is verifying both ecuations
a1*x+b1=a2*x+b2
=>
x=(b2-b1)/(a1-a2) and
y=a1*(b2-b1)/(a1-a2)+b1

then we delete the points where the radius is starting and replace them with this intersection
in this way we can transform any filleted contour in rugged one

Bella Italia, arrivederci Roma smile

RE: Create Dimensions in isometric view through macro.

I forgot to mention ...
we must put some conditions like the lines to have different angles a1<>a2 (or a1<>-a2, I forgot how it's called this function, you know it ...) to avoid the situation when they are paralel

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources