Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create Dimensions in isometric view through macro.

Status
Not open for further replies.

Maddy02

Mechanical
Feb 14, 2013
114
IN
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
 
Replies continue below

Recommended for you

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

 
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
 
 http://files.engineering.com/getfile.aspx?folder=dc2bca82-84b0-4ffd-9696-8b08df2f6c94&file=Tubing.rar
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
 
Hi,

Thanks again, will attach R18 files in few hours.

Regards,
Maddy
 
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
 
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
 
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
 
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
 
Helau Senor Fredo, helau - helau, I am back in business !

"Is not so easy, drafting workbench is not so friendly" :-D 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 :)
 
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top